ArchIFC.IfcRoot Class Reference

Public Member Functions

def addIfcAttribute (self, obj, attribute)
 
def addIfcAttributes (self, ifcTypeSchema, obj)
 
def addIfcAttributeValueExpressions (self, obj, attribute)
 
def getCanonicalisedIfcTypes (self)
 
def getIfcAttributeSchema (self, ifcTypeSchema, name)
 
def getIfcSchema (self)
 
def getIfcTypeSchema (self, IfcType)
 
def getObjIfcComplexAttribute (self, obj, attributeName)
 
def migrateDeprecatedAttributes (self, obj)
 
def onChanged (self, obj, prop)
 
def purgeUnusedIfcAttributesFromPropertiesList (self, ifcTypeSchema, obj)
 
def setObjIfcAttributeValue (self, obj, attributeName, value)
 
def setObjIfcComplexAttributeValue (self, obj, attributeName, value)
 
def setProperties (self, obj)
 
def setupIfcAttributes (self, obj)
 
def setupIfcComplexAttributes (self, obj)
 

Detailed Description

This class defines the common methods and properties for managing IFC data.

IFC, or Industry Foundation Classes are a standardised way to digitally
describe the built environment.  The ultimate goal of IFC is to provide
better interoperability between software that deals with the built
environment. You can learn more here:
https://technical.buildingsmart.org/standards/ifc/

You can learn more about the technical details of the IFC schema here:
https://standards.buildingsmart.org/IFC/RELEASE/IFC4/FINAL/HTML/

This class is further segmented down into IfcProduct and IfcContext.

Member Function Documentation

◆ addIfcAttribute()

def ArchIFC.IfcRoot.addIfcAttribute (   self,
  obj,
  attribute 
)
Add an IFC type's attribute to the object, within its properties.

Add the attribute's schema to the object's IfcData property, as an
item under its "attributes" array.

Also add the attribute as a property of the object.

Parameters
----------
attribute: dict
    The attribute to add. Should have the structure of an attribute
    found within the IFC schemas.

References ArchIFC.QT_TRANSLATE_NOOP().

Referenced by ArchIFC.IfcRoot.addIfcAttributes().

◆ addIfcAttributes()

def ArchIFC.IfcRoot.addIfcAttributes (   self,
  ifcTypeSchema,
  obj 
)
Add the attributes of the IFC type's schema to the object's properties.

Add the attributes as properties of the object. Also add the
attribute's schema within the object's IfcData property. Do so using
the .addIfcAttribute() method.

Also add expressions to copy data from the object's editable
properties.  This means the IFC properties will remain accurate with
the actual values of the object. Do not do so for all IFC properties.
Do so using the .addIfcAttributeValueExpressions() method.

Learn more about expressions here:
https://wiki.freecadweb.org/Expressions

Do not add the attribute if the object has a property with the
attribute's name. Also do not add the attribute if its name is
RefLatitude, RefLongitude, or Name.

Parameters
----------
ifcTypeSchema: dict
    The schema of the IFC type.

References ArchIFC.IfcRoot.addIfcAttribute(), and ArchIFC.IfcRoot.addIfcAttributeValueExpressions().

Referenced by ArchIFC.IfcRoot.setupIfcAttributes().

◆ addIfcAttributeValueExpressions()

def ArchIFC.IfcRoot.addIfcAttributeValueExpressions (   self,
  obj,
  attribute 
)
Add expressions for IFC attributes, so they stay accurate with the object.

Add expressions to the object that copy data from the editable
properties of the object. This ensures that the IFC attributes will
remain accurate with the actual values of the object.

Currently, add expressions for the following IFC attributes:

- OverallWidth
- OverallHeight
- ElevationWithFlooring
- Elevation
- NominalDiameter
- BarLength
- RefElevation
- LongName

Learn more about expressions here:
https://wiki.freecadweb.org/Expressions

Parameters
----------
attribute: dict
    The schema of the attribute to add the expression for.

Referenced by ArchIFC.IfcRoot.addIfcAttributes().

◆ getCanonicalisedIfcTypes()

def ArchIFC.IfcRoot.getCanonicalisedIfcTypes (   self)
Get the names of IFC types, converted to the form used in Arch.

Change the names of all IFC types to a more human readable form which
is used instead throughout Arch instead of the raw type names. The
names have the "Ifc" stripped from the start of their name, and spaces
inserted between the words.

Returns
-------
list of str
    The list of every IFC type name in their form used in Arch. List
    will have names in the same order as they appear in the schema's
    JSON, as per the .keys() method of dicts.

References ArchIFC.IfcRoot.getIfcSchema(), ArchIFC.IfcProduct.getIfcSchema(), and ArchIFC.IfcContext.getIfcSchema().

Referenced by ArchIFC.IfcRoot.setProperties().

◆ getIfcAttributeSchema()

def ArchIFC.IfcRoot.getIfcAttributeSchema (   self,
  ifcTypeSchema,
  name 
)
Get the schema of an IFC attribute with the given name.

Convert the IFC attribute's name from the human readable version Arch
uses, and convert it to the less readable name it has in the IFC
schema.

Parameters
----------
ifcTypeSchema: dict
    The schema of the IFC type to access the attribute of.
name: str
    The name the attribute has in Arch.

Returns
-------
dict
    Returns the schema of the attribute.
None
    Returns None if the IFC type does not have the attribute requested.

Referenced by ArchIFC.IfcRoot.purgeUnusedIfcAttributesFromPropertiesList().

◆ getIfcSchema()

def ArchIFC.IfcRoot.getIfcSchema (   self)
Get the IFC schema of all types relevant to this class.

Intended to be overwritten by the classes that inherit this class.

Returns
-------
dict
    The schema of all the types relevant to this class.

Reimplemented in ArchIFC.IfcProduct, and ArchIFC.IfcContext.

Referenced by ArchIFC.IfcRoot.getCanonicalisedIfcTypes(), and ArchIFC.IfcRoot.getIfcTypeSchema().

◆ getIfcTypeSchema()

def ArchIFC.IfcRoot.getIfcTypeSchema (   self,
  IfcType 
)
Get the schema of the IFC type provided.

If the IFC type is undefined, return the schema of the
IfcBuildingElementProxy.

Parameter
---------
IfcType: str
    The IFC type whose schema you want.

Returns
-------
dict
    Returns the schema of the type as a dict.
None
    Returns None if the IFC type does not exist.

References ArchIFC.IfcRoot.getIfcSchema(), ArchIFC.IfcProduct.getIfcSchema(), and ArchIFC.IfcContext.getIfcSchema().

Referenced by ArchIFC.IfcRoot.setupIfcAttributes(), and ArchIFC.IfcRoot.setupIfcComplexAttributes().

◆ getObjIfcComplexAttribute()

def ArchIFC.IfcRoot.getObjIfcComplexAttribute (   self,
  obj,
  attributeName 
)
Get the value of the complex attribute, as stored in the IfcData JSON.

Parameters
----------
attributeName: str
    The name of the complex attribute to access.

Returns
-------
The value of the complex attribute.

Referenced by ArchIFCView.IfcContextUI.prefillMapConversionForm().

◆ migrateDeprecatedAttributes()

def ArchIFC.IfcRoot.migrateDeprecatedAttributes (   self,
  obj 
)
Update the object to use the newer property names for IFC related properties.

Referenced by ArchIFC.IfcRoot.setProperties().

◆ onChanged()

def ArchIFC.IfcRoot.onChanged (   self,
  obj,
  prop 
)
Method called when the object has a property changed.

If the object's IfcType has changed, change the object's properties
that relate to IFC attributes in order to match the IFC schema
definition of the new IFC type.

If a property changes that is in the "IFC Attributes" group, also
change the value stored in the IfcData property's JSON.

Parameters
----------
prop: string
    The name of the property that has changed.

Reimplemented in ArchBuildingPart.BuildingPart, ArchComponent.Component, ArchCurtainWall.CurtainWall, and ArchTruss.Truss.

References ArchIFC.IfcRoot.setObjIfcAttributeValue(), ArchIFC.IfcRoot.setupIfcAttributes(), and ArchIFC.IfcRoot.setupIfcComplexAttributes().

Referenced by ArchStructure.CommandStructuralSystem.Activated(), draftviewproviders.view_base.ViewProviderDraft.attach(), ArchSite.Compass.buildCoordinates(), draftobjects.wire.Wire.execute(), ArchBuildingPart.ViewProviderBuildingPart.updateData(), ArchPanel.ViewProviderPanelCut.updateData(), ArchPanel.ViewProviderPanelSheet.updateData(), draftviewproviders.view_label.ViewProviderLabel.updateData(), draftviewproviders.view_layer.ViewProviderLayer.updateData(), and draftviewproviders.view_wpproxy.ViewProviderWorkingPlaneProxy.updateData().

◆ purgeUnusedIfcAttributesFromPropertiesList()

def ArchIFC.IfcRoot.purgeUnusedIfcAttributesFromPropertiesList (   self,
  ifcTypeSchema,
  obj 
)
Remove properties representing IFC attributes if they no longer appear.

Remove the property representing an IFC attribute, if it does not
appear in the schema of the IFC type provided. Also, remove the
property if its attribute is an enum type, presumably for backwards
compatibility.

Learn more about IFC enums here:
https://standards.buildingsmart.org/IFC/RELEASE/IFC4/FINAL/HTML/schema/chapter-3.htm#enumeration

References ArchIFC.IfcRoot.getIfcAttributeSchema().

Referenced by ArchIFC.IfcRoot.setupIfcAttributes().

◆ setObjIfcAttributeValue()

def ArchIFC.IfcRoot.setObjIfcAttributeValue (   self,
  obj,
  attributeName,
  value 
)
Change the value of an IFC attribute within the IfcData property's json.

Parameters
----------
attributeName: str
    The name of the attribute to change.
value:
    The new value to set.

Referenced by ArchIFC.IfcRoot.onChanged().

◆ setObjIfcComplexAttributeValue()

def ArchIFC.IfcRoot.setObjIfcComplexAttributeValue (   self,
  obj,
  attributeName,
  value 
)
Changes the value of the complex attribute in the IfcData property JSON.

Parameters
----------
attributeName: str
    The name of the attribute to change.
value:
    The new value to set.

Referenced by ArchIFCView.IfcContextUI.accept(), and importIFCHelper.ProjectImporter.setComplexAttributes().

◆ setProperties()

◆ setupIfcAttributes()

def ArchIFC.IfcRoot.setupIfcAttributes (   self,
  obj 
)
Set up the IFC attributes in the object's properties.

Add the attributes specified in the object's IFC type schema, to the
object's properties. Do not re-add them if they're already present.
Also remove old IFC attribute properties that no longer appear in the
schema for backwards compatibility.

Do so using the .addIfcAttributes() and
.purgeUnusedIfcAttributesFromPropertiesList() methods.

Learn more about IFC attributes here:
https://standards.buildingsmart.org/IFC/RELEASE/IFC4/FINAL/HTML/schema/chapter-3.htm#attribute

References ArchIFC.IfcRoot.addIfcAttributes(), ArchIFC.IfcRoot.getIfcTypeSchema(), and ArchIFC.IfcRoot.purgeUnusedIfcAttributesFromPropertiesList().

Referenced by ArchIFC.IfcRoot.onChanged().

◆ setupIfcComplexAttributes()

def ArchIFC.IfcRoot.setupIfcComplexAttributes (   self,
  obj 
)
Add the IFC type's complex attributes to the object.

Get the object's IFC type schema, and add the schema for the type's
complex attributes within the IfcData property.

References ArchIFC.IfcRoot.getIfcTypeSchema().

Referenced by ArchIFC.IfcRoot.onChanged().


The documentation for this class was generated from the following file: