Ejemplo n.º 1
0
 private System.Collections.Generic.IEnumerable <IntPtr> findEntity(IntPtr entities, IntPtr entityCount)
 {
     for (int iEntity = 0; iEntity < entityCount.ToInt32(); iEntity++)
     {
         IntPtr iEntityInstance = IntPtr.Zero;
         _ifcEngine.GetAggregationElement(entities, iEntity, IfcEngine.SdaiType.Instance, out iEntityInstance);
         yield return(iEntityInstance);
     }
 }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        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");
            }
        }