/// <summary> /// Sets best material id for current export state. /// </summary> /// <param name="geometryObject">The geometry object to get the best material id.</param> /// <param name="exporterIFC">The ExporterIFC object.</param> public static void SetBestMaterialIdInExporter(GeometryObject geometryObject, ExporterIFC exporterIFC) { ElementId materialId = GetBestMaterialIdForGeometry(geometryObject, exporterIFC); if (materialId != ElementId.InvalidElementId) exporterIFC.SetMaterialIdForCurrentExportState(materialId); }
/// <summary> /// Sets best material id for current export state. /// </summary> /// <param name="geometryObject">The geometry object to get the best material id.</param> /// <param name="element">The element to get its structual material if no material found in its geometry.</param> /// <param name="overrideMaterialId">The material id to override the one gets from geometry object.</param> /// <param name="exporterIFC">The ExporterIFC object.</param> /// <returns>The material id.</returns> public static ElementId SetBestMaterialIdInExporter(GeometryObject geometryObject, Element element, ElementId overrideMaterialId, ExporterIFC exporterIFC) { ElementId materialId = overrideMaterialId != ElementId.InvalidElementId ? overrideMaterialId : GetBestMaterialIdFromGeometryOrParameter(geometryObject, exporterIFC, element); if (materialId != ElementId.InvalidElementId) exporterIFC.SetMaterialIdForCurrentExportState(materialId); return materialId; }