protected override void Process(IFCAnyHandle ifcMaterial) { base.Process(ifcMaterial); Name = IFCImportHandleUtil.GetRequiredStringAttribute(ifcMaterial, "Name", true); List <IFCAnyHandle> hasRepresentation = null; if (IFCImportFile.TheFile.SchemaVersion >= IFCSchemaVersion.IFC2x3) { hasRepresentation = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcMaterial, "HasRepresentation"); } if (hasRepresentation != null && hasRepresentation.Count == 1) { if (!IFCAnyHandleUtil.IsSubTypeOf(hasRepresentation[0], IFCEntityType.IfcMaterialDefinitionRepresentation)) { Importer.TheLog.LogUnexpectedTypeError(hasRepresentation[0], IFCEntityType.IfcMaterialDefinitionRepresentation, false); } else { MaterialDefinitionRepresentation = IFCProductRepresentation.ProcessIFCProductRepresentation(hasRepresentation[0]); } } Importer.TheLog.AddToElementCount(); }
/// <summary> /// Processes IfcProduct attributes. /// </summary> /// <param name="ifcProduct">The IfcProduct handle.</param> protected override void Process(IFCAnyHandle ifcProduct) { base.Process(ifcProduct); ProcessObjectPlacement(ifcProduct); IFCAnyHandle ifcProductRepresentation = IFCImportHandleUtil.GetOptionalInstanceAttribute(ifcProduct, "Representation"); if (!IFCAnyHandleUtil.IsNullOrHasNoValue(ifcProductRepresentation)) { ProductRepresentation = IFCProductRepresentation.ProcessIFCProductRepresentation(ifcProductRepresentation); } }
/// <summary> /// Processes IfcProduct attributes. /// </summary> /// <param name="ifcProduct">The IfcProduct handle.</param> protected override void Process(IFCAnyHandle ifcProduct) { // We are going to process the IfcObjectPlacement before we do the base Process call. The reason for this is that we'd like to // process the IfcSite object placement before any of its children, so that the RelativeToSite can be properly set. // If this becomes an issue, we can instead move this to after the base.Process, and calculate RelativeToSite as a post-process step. ProcessObjectPlacement(ifcProduct); base.Process(ifcProduct); IFCAnyHandle ifcProductRepresentation = IFCImportHandleUtil.GetOptionalInstanceAttribute(ifcProduct, "Representation"); if (!IFCAnyHandleUtil.IsNullOrHasNoValue(ifcProductRepresentation)) { ProductRepresentation = IFCProductRepresentation.ProcessIFCProductRepresentation(ifcProductRepresentation); } }