Ejemplo n.º 1
0
        /// <summary>
        /// Processes IfcTypeObject attributes.
        /// </summary>
        /// <param name="ifcTypeObject">The IfcTypeObject handle.</param>
        protected override void Process(IFCAnyHandle ifcTypeObject)
        {
            base.Process(ifcTypeObject);

            HashSet <IFCAnyHandle> propertySets = IFCAnyHandleUtil.GetAggregateInstanceAttribute
                                                  <HashSet <IFCAnyHandle> >(ifcTypeObject, "HasPropertySets");

            if (propertySets != null)
            {
                m_IFCPropertySets = new Dictionary <string, IFCPropertySetDefinition>();

                foreach (IFCAnyHandle propertySet in propertySets)
                {
                    IFCPropertySetDefinition ifcPropertySetDefinition = IFCPropertySetDefinition.ProcessIFCPropertySetDefinition(propertySet);
                    if (ifcPropertySetDefinition != null)
                    {
                        string name = ifcPropertySetDefinition.Name;
                        if (string.IsNullOrWhiteSpace(name))
                        {
                            name = IFCAnyHandleUtil.GetEntityType(propertySet).ToString() + " " + propertySet.StepId;
                        }
                        m_IFCPropertySets[name] = ifcPropertySetDefinition;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Processes IfcRelDefinesByProperties.
        /// </summary>
        /// <param name="ifcRelDefinesByProperties">The IfcRelDefinesByProperties handle.</param>
        void ProcessIFCRelDefinesByProperties(IFCAnyHandle ifcRelDefinesByProperties)
        {
            IFCAnyHandle propertySetDefinition = IFCAnyHandleUtil.GetInstanceAttribute(ifcRelDefinesByProperties, "RelatingPropertyDefinition");

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(propertySetDefinition))
            {
                IFCImportFile.TheLog.LogNullError(IFCEntityType.IfcPropertySetDefinition);
                return;
            }

            IFCPropertySetDefinition ifcPropertySet = IFCPropertySetDefinition.ProcessIFCPropertySetDefinition(propertySetDefinition);

            if (ifcPropertySet != null)
            {
                int propertySetNumber = 1;
                while (true)
                {
                    string name = (propertySetNumber == 1) ? ifcPropertySet.Name : ifcPropertySet.Name + " " + propertySetNumber.ToString();
                    if (PropertySets.ContainsKey(name))
                    {
                        propertySetNumber++;
                    }
                    else
                    {
                        PropertySets[name] = ifcPropertySet;
                        break;
                    }
                }
            }
        }