本文整理汇总了C#中BIM.IFC.Utility.ProductWrapper.AddFinishMaterial方法的典型用法代码示例。如果您正苦于以下问题:C# ProductWrapper.AddFinishMaterial方法的具体用法?C# ProductWrapper.AddFinishMaterial怎么用?C# ProductWrapper.AddFinishMaterial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BIM.IFC.Utility.ProductWrapper
的用法示例。
在下文中一共展示了ProductWrapper.AddFinishMaterial方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportHostObjectMaterials
//.........这里部分代码省略.........
widths.Add(cs.GetLayerWidth(i));
// save layer function into ProductWrapper,
// it's used while exporting "Function" of Pset_CoveringCommon
functions.Add(cs.GetLayerFunction(i));
}
}
if (matIds.Count == 0)
{
matIds.Add(baseMatId);
widths.Add(cs != null ? cs.GetWidth() : 0);
functions.Add(MaterialFunctionAssignment.None);
}
List<IFCAnyHandle> layers = new List<IFCAnyHandle>();
double thickestLayer = 0.0;
for (int i = 0; i < matIds.Count; ++i)
{
if (widths[i] < MathUtil.Eps())
continue;
IFCAnyHandle materialHnd = CategoryUtil.GetOrCreateMaterialHandle(hostObjAttr.Document, exporterIFC, matIds[i], true);
if (primaryMaterialHnd == null || (widths[i] > thickestLayer))
{
primaryMaterialHnd = materialHnd;
thickestLayer = widths[i];
}
double scaledWidth = widths[i] * scale;
IFCAnyHandle materialLayer = IFCInstanceExporter.CreateMaterialLayer(file, materialHnd, scaledWidth, null);
layers.Add(materialLayer);
if ((productWrapper != null) && (functions[i] == MaterialFunctionAssignment.Finish1 || functions[i] == MaterialFunctionAssignment.Finish2))
{
productWrapper.AddFinishMaterial(materialHnd);
}
}
if (layers.Count == 0)
return false;
string layerSetName = exporterIFC.GetFamilyName();
materialLayerSet = IFCInstanceExporter.CreateMaterialLayerSet(file, layers, layerSetName);
ExporterCacheManager.MaterialLayerSetCache.Register(typeElemId, materialLayerSet);
ExporterCacheManager.MaterialLayerSetCache.RegisterPrimaryMaterialHnd(typeElemId, primaryMaterialHnd);
}
// IfcMaterialLayerSetUsage is not supported for IfcWall, only IfcWallStandardCase.
IFCAnyHandle layerSetUsage = null;
for (int ii = 0; ii < elemHnds.Count; ii++)
{
IFCAnyHandle elemHnd = elemHnds[ii];
if (IFCAnyHandleUtil.IsNullOrHasNoValue(elemHnd))
continue;
HashSet<IFCAnyHandle> relDecomposesSet = IFCAnyHandleUtil.GetRelDecomposes(elemHnd);
IList<IFCAnyHandle> subElemHnds = new List<IFCAnyHandle>();
if (relDecomposesSet != null && relDecomposesSet.Count == 1)
{
IFCAnyHandle relAggregates = relDecomposesSet.First();
if (IFCAnyHandleUtil.IsTypeOf(relAggregates, IFCEntityType.IfcRelAggregates))
{
IFCData ifcData = relAggregates.GetAttribute("RelatedObjects");
if (ifcData.PrimitiveType == IFCDataPrimitiveType.Aggregate)
{