Exemple #1
0
        public static Dictionary <IfcLabel, Dictionary <IfcIdentifier, IfcValue> > GetAllPropertySingleValues(this Xbim.Ifc2x3.Kernel.IfcTypeObject obj)
        {
            Dictionary <IfcLabel, Dictionary <IfcIdentifier, IfcValue> > result = new Dictionary <IfcLabel, Dictionary <IfcIdentifier, IfcValue> >();
            PropertySetDefinitionSet pSets = obj.HasPropertySets;

            if (pSets == null)
            {
                return(result);
            }
            IEnumerable <IfcPropertySet> pSetsPure = pSets.OfType <IfcPropertySet>();

            foreach (IfcPropertySet pSet in pSetsPure)
            {
                Dictionary <IfcIdentifier, IfcValue> value = new Dictionary <IfcIdentifier, IfcValue>();
                IfcLabel psetName = pSet.Name ?? null;
                foreach (IfcProperty prop in pSet.HasProperties)
                {
                    IfcPropertySingleValue singleVal = prop as IfcPropertySingleValue;
                    if (singleVal == null)
                    {
                        continue;
                    }
                    value.Add(prop.Name, singleVal.NominalValue);
                }
                result.Add(psetName, value);
            }
            return(result);
        }
Exemple #2
0
 public void CreateHasPropertySets()
 {
     if (_hasPropertySets == null) _hasPropertySets = new PropertySetDefinitionSet(this);
 }
Exemple #3
0
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
         case 2:
         case 3:
             base.IfcParse(propIndex, value);
             break;
         case 4:
             _applicableOccurrence = value.StringVal;
             break;
         case 5:
             if (_hasPropertySets == null)
                 _hasPropertySets = new PropertySetDefinitionSet(this);
             _hasPropertySets.Add((IfcPropertySetDefinition)value.EntityVal);
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }