/// <summary> /// Processes an IFCBuildingElementComponent object. /// </summary> /// <param name="ifcBuildingElementComponent">The IfcBuildingElementComponent handle.</param> /// <returns>The IFCBuildingElementComponent object.</returns> public static IFCBuildingElementComponent ProcessIFCBuildingElementComponent(IFCAnyHandle ifcBuildingElementComponent) { if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcBuildingElementComponent)) { Importer.TheLog.LogNullError(IFCEntityType.IfcBuildingElementComponent); return(null); } IFCEntity buildingElementComponent; IFCImportFile.TheFile.EntityMap.TryGetValue(ifcBuildingElementComponent.StepId, out buildingElementComponent); if (buildingElementComponent != null) { return(buildingElementComponent as IFCBuildingElementComponent); } IFCBuildingElementComponent newIFCBuildingElementComponent = null; // other subclasses not handled yet. if (IFCAnyHandleUtil.IsValidSubTypeOf(ifcBuildingElementComponent, IFCEntityType.IfcBuildingElementPart)) { newIFCBuildingElementComponent = IFCBuildingElementPart.ProcessIFCBuildingElementPart(ifcBuildingElementComponent); } else { newIFCBuildingElementComponent = new IFCBuildingElementComponent(ifcBuildingElementComponent); } return(newIFCBuildingElementComponent); }
/// <summary> /// Processes an IFCBuildingElement object. /// </summary> /// <param name="ifcBuildingElement">The IfcBuildingElement handle.</param> /// <returns>The IFCBuildingElement object.</returns> public static IFCBuildingElement ProcessIFCBuildingElement(IFCAnyHandle ifcBuildingElement) { if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcBuildingElement)) { Importer.TheLog.LogNullError(IFCEntityType.IfcBuildingElement); return(null); } IFCEntity buildingElement; IFCImportFile.TheFile.EntityMap.TryGetValue(ifcBuildingElement.StepId, out buildingElement); if (buildingElement != null) { return(buildingElement as IFCBuildingElement); } try { IFCBuildingElement newIFCBuildingElement = null; // other subclasses not handled yet. if (SchemaSupportsBuildingElementComponentAsSubType() && IFCAnyHandleUtil.IsValidSubTypeOf(ifcBuildingElement, IFCEntityType.IfcBuildingElementComponent)) { newIFCBuildingElement = IFCBuildingElementComponent.ProcessIFCBuildingElementComponent(ifcBuildingElement); } else { newIFCBuildingElement = new IFCBuildingElement(ifcBuildingElement); } return(newIFCBuildingElement); } catch (Exception ex) { HandleError(ex.Message, ifcBuildingElement, true); return(null); } }
/// <summary> /// Processes an IFCBuildingElementComponent object. /// </summary> /// <param name="ifcBuildingElementComponent">The IfcBuildingElementComponent handle.</param> /// <returns>The IFCBuildingElementComponent object.</returns> public static IFCBuildingElementComponent ProcessIFCBuildingElementComponent(IFCAnyHandle ifcBuildingElementComponent) { if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcBuildingElementComponent)) { Importer.TheLog.LogNullError(IFCEntityType.IfcBuildingElementComponent); return null; } IFCEntity buildingElementComponent; IFCImportFile.TheFile.EntityMap.TryGetValue(ifcBuildingElementComponent.StepId, out buildingElementComponent); if (buildingElementComponent != null) return (buildingElementComponent as IFCBuildingElementComponent); IFCBuildingElementComponent newIFCBuildingElementComponent = null; // other subclasses not handled yet. if (IFCAnyHandleUtil.IsSubTypeOf(ifcBuildingElementComponent, IFCEntityType.IfcBuildingElementPart)) newIFCBuildingElementComponent = IFCBuildingElementPart.ProcessIFCBuildingElementPart(ifcBuildingElementComponent); else newIFCBuildingElementComponent = new IFCBuildingElementComponent(ifcBuildingElementComponent); return newIFCBuildingElementComponent; }