protected override void Process(IFCAnyHandle ifcMaterialLayerSet) { base.Process(ifcMaterialLayerSet); IList <IFCAnyHandle> ifcMaterialLayers = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcMaterialLayerSet, "MaterialLayers"); if (ifcMaterialLayers == null) { Importer.TheLog.LogError(ifcMaterialLayerSet.Id, "Expected at least 1 IfcMaterialLayer, found none.", false); return; } foreach (IFCAnyHandle ifcMaterialLayer in ifcMaterialLayers) { IFCMaterialLayer materialLayer = null; if (materialLayer is IFCMaterialLayerWithOffsets) { materialLayer = IFCMaterialLayerWithOffsets.ProcessIFCMaterialLayerWithOffsets(ifcMaterialLayer); } else { materialLayer = IFCMaterialLayer.ProcessIFCMaterialLayer(ifcMaterialLayer); } if (materialLayer != null) { MaterialLayers.Add(materialLayer); } } LayerSetName = IFCImportHandleUtil.GetOptionalStringAttribute(ifcMaterialLayerSet, "LayerSetName", null); }
internal override void ParseXml(XmlElement xml) { base.ParseXml(xml); foreach (XmlNode child in xml.ChildNodes) { string name = child.Name; if (string.Compare(name, "MaterialLayers") == 0) { foreach (XmlNode node in child.ChildNodes) { IfcMaterialLayer l = mDatabase.ParseXml <IfcMaterialLayer>(node as XmlElement); if (l != null) { MaterialLayers.Add(l); } } } } if (xml.HasAttribute("LayerSetName")) { LayerSetName = xml.Attributes["LayerSetName"].Value; } if (xml.HasAttribute("Description")) { Description = xml.Attributes["Description"].Value; } }