Code: Select all
if "IfcUID" in obj.IfcData:
In recent versions of FreeCAD IfcAttributes has been renamed to IfcData (because there exists such things as IFC attributes, so our internal dict was better with another name)
It basically works like this: Only Arch objects can have an IFC UID (they don't always have one). When importing from an IFC file, all IFC GUIDs are retrieved. When saving a FreeCAD model to IFC, all generated IFC GUIDS are also saved back in the FreeCAD document. So the best way to automatically add an IFC GUID to all the Arch objects in your document, is simply to export it to IFC.
The IfcData property also contains dynamic attributes that are added/removed when you change the IFC type (all managed in ArchIFC.py)
The IFC properties are stored in the IfcProperties property, under one of these two forms:
"propertyname" : "propertyset;;propertytype;;propertyvalue"
or (in FreeCAD0.19, so you can have different properties with same name in different psets):
"propertyname;;propertyset" : "propertytype;;propertyvalue"
The properties manager is greyed out if you are using FreeCAD 0.18, because there was incomplete support for it...