Exemplo n.º 1
0
        /// <summary>
        /// Processes IfcObject handle.
        /// </summary>
        /// <param name="ifcObject">The IfcObject handle.</param>
        /// <returns>The IfcObject object.</returns>
        public static IFCObject ProcessIFCObject(IFCAnyHandle ifcObject)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcObject))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcObject);
                return(null);
            }

            IFCEntity cachedObject;

            if (IFCImportFile.TheFile.EntityMap.TryGetValue(ifcObject.StepId, out cachedObject))
            {
                return(cachedObject as IFCObject);
            }

            if (IFCAnyHandleUtil.IsSubTypeOf(ifcObject, IFCEntityType.IfcProduct))
            {
                return(IFCProduct.ProcessIFCProduct(ifcObject));
            }
            else if (IFCAnyHandleUtil.IsSubTypeOf(ifcObject, IFCEntityType.IfcProject))
            {
                return(IFCProject.ProcessIFCProject(ifcObject));
            }
            else if (IFCAnyHandleUtil.IsSubTypeOf(ifcObject, IFCEntityType.IfcGroup))
            {
                return(IFCGroup.ProcessIFCGroup(ifcObject));
            }

            Importer.TheLog.LogUnhandledSubTypeError(ifcObject, IFCEntityType.IfcObject, true);
            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Finds all related objects in ifcRelAssigns.
        /// </summary>
        /// <param name="ifcRelAssigns">The IfcRelAssigns handle.</param>
        void ProcessIFCRelAssigns(IFCAnyHandle ifcRelAssigns)
        {
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcRelAssigns, IFCEntityType.IfcRelAssignsToGroup))
            {
                IFCGroup group = ProcessIFCRelation.ProcessRelatingGroup(ifcRelAssigns);
                group.RelatedObjects.Add(this);
                AssignmentGroups.Add(group);
            }

            // LOG: ERROR: #: Unknown assocation of type ifcRelAssigns.GetEntityType();
        }
        /// <summary>
        /// Finds contained systems.
        /// </summary>
        /// <param name="ifcRelHandle">The relation handle.</param>
        void ProcessIFCRelServicesBuildings(IFCAnyHandle ifcRelHandle)
        {
            IFCAnyHandle relatingSystem = IFCAnyHandleUtil.GetInstanceAttribute(ifcRelHandle, "RelatingSystem");

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(relatingSystem))
            {
                IFCImportFile.TheLog.LogMissingRequiredAttributeError(ifcRelHandle, "RelatingSystem", false);
                return;
            }

            IFCGroup system = IFCGroup.ProcessIFCGroup(relatingSystem);

            if (system != null)
            {
                m_IFCSystems.Add(system);
            }
        }