protected override void Process(IFCAnyHandle ifcMaterialLayerWithOffsets) { base.Process(ifcMaterialLayerWithOffsets); OffsetValues = IFCAnyHandleUtil.GetAggregateDoubleAttribute <List <double> >(ifcMaterialLayerWithOffsets, "OffsetValues"); OffsetDirection = (IFCLayerSetDirection)Enum.Parse(typeof(IFCLayerSetDirection), IFCAnyHandleUtil.GetEnumerationAttribute(ifcMaterialLayerWithOffsets, "OffsetDirection")); }
/// <summary> /// Creates an IfcMaterialLayerSetUsage and assigns it to the file. /// </summary> /// <param name="file">The file.</param> /// <param name="materialLayerSet">The material layer set handle.</param> /// <param name="direction">The direction of the material layer set.</param> /// <param name="directionSense">The direction sense.</param> /// <param name="offset">Offset of the material layer set base line (MlsBase) from reference geometry (line or plane).</param> /// <returns>The handle.</returns> public static IFCAnyHandle CreateMaterialLayerSetUsage(IFCFile file, IFCAnyHandle materialLayerSet, IFCLayerSetDirection direction, IFCDirectionSense directionSense, double offset) { IFCAnyHandleUtil.ValidateSubTypeOf(materialLayerSet, false, IFCEntityType.IfcMaterialLayerSet); IFCAnyHandle materialLayerSetUsage = CreateInstance(file, IFCEntityType.IfcMaterialLayerSetUsage); IFCAnyHandleUtil.SetAttribute(materialLayerSetUsage, "ForLayerSet", materialLayerSet); IFCAnyHandleUtil.SetAttribute(materialLayerSetUsage, "LayerSetDirection", direction); IFCAnyHandleUtil.SetAttribute(materialLayerSetUsage, "DirectionSense", directionSense); IFCAnyHandleUtil.SetAttribute(materialLayerSetUsage, "OffsetFromReferenceLine", offset); return materialLayerSetUsage; }
public static IFCAnyHandle CreateMaterialLayerSetUsage(IFCFile file, IFCAnyHandle materialLayerSet, IFCLayerSetDirection direction, IFCDirectionSense directionSense, double offset) { string materialLayerSetName = IFCAnyHandleUtil.GetStringAttribute(materialLayerSet, "LayerSetName"); string hash = materialLayerSetName + ":" + direction.ToString() + ":" + directionSense.ToString() + ":" + offset.ToString(); IFCAnyHandle matSetUsage = ExporterCacheManager.MaterialSetUsageCache.GetHandle(hash); if (matSetUsage == null) { matSetUsage = IFCInstanceExporter.CreateMaterialLayerSetUsage(file, materialLayerSet, direction, directionSense, offset); ExporterCacheManager.MaterialSetUsageCache.AddHash(matSetUsage, hash); } return(matSetUsage); }