private IntPtr getAggregator(String entityName, out IntPtr memberCount) { IntPtr aggregator = _ifcEngine.GetEntityExtent(_ifcModel, entityName); memberCount = _ifcEngine.GetMemberCount(aggregator); return(aggregator); }
private void CreateProjectTreeItems() { var iEntityID = IFCEngine.GetEntityExtent(IfcModel, "IfcProject"); var iEntitiesCount = IFCEngine.GetMemberCount(iEntityID); for (int iEntity = 0; iEntity < iEntitiesCount.ToInt32(); iEntity++) { IFCEngine.GetAggregationElement(iEntityID, iEntity, IfcEngine.SdaiType.Instance, out IntPtr iInstance); IFCTreeItem ifcTreeItem = new IFCTreeItem(); ifcTreeItem.instance = iInstance; CreateTreeItem(null, ifcTreeItem); AddChildrenTreeItems(ifcTreeItem, iInstance, "IfcSite"); } }
private void RetrieveObjects(IntPtr ifcModel, string sObjectSPFFName, string ObjectDisplayName) { IntPtr ifcObjectInstances = _ifcEngine.GetEntityExtent(ifcModel, ObjectDisplayName), noIfcObjectIntances = _ifcEngine.GetMemberCount(ifcObjectInstances); if (noIfcObjectIntances != IntPtr.Zero) { IFCItem NewItem = null; if (_rootIfcItem == null) { _rootIfcItem = new IFCItem(); _rootIfcItem.CreateItem(null, IntPtr.Zero, "", ObjectDisplayName, "", ""); NewItem = _rootIfcItem; } else { IFCItem LastItem = _rootIfcItem; while (LastItem != null) { if (LastItem.next == null) { LastItem.next = new IFCItem(); LastItem.next.CreateItem(null, IntPtr.Zero, "", ObjectDisplayName, "", ""); NewItem = LastItem.next; break; } else { LastItem = LastItem.next; } } ; } for (int i = 0; i < noIfcObjectIntances.ToInt32(); ++i) { IntPtr ifcObjectIns = IntPtr.Zero; _ifcEngine.GetAggregationElement(ifcObjectInstances, i, IfcEngine.SdaiType.Instance, out ifcObjectIns); IntPtr value = IntPtr.Zero; _ifcEngine.GetAttribute(ifcObjectIns, "GlobalId", IfcEngine.SdaiType.Unicode, out value); string globalID = Marshal.PtrToStringUni((IntPtr)value); value = IntPtr.Zero; _ifcEngine.GetAttribute(ifcObjectIns, "Name", IfcEngine.SdaiType.Unicode, out value); string name = Marshal.PtrToStringUni((IntPtr)value); value = IntPtr.Zero; _ifcEngine.GetAttribute(ifcObjectIns, "Description", IfcEngine.SdaiType.Unicode, out value); string description = Marshal.PtrToStringUni((IntPtr)value); IFCItem subItem = new IFCItem(); subItem.CreateItem(NewItem, ifcObjectIns, ObjectDisplayName, globalID, name, description); } } }