Adding Pset_Address to a building #3228
Replies: 2 comments 4 replies
-
I tried various things, but I couldn't get a RecursionError to pop up. Can you maybe share full working code?
In my test the tuple get serialized into a string as a single label. Looking at the code around here https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py#L258 there will be various things that need changing, like testing for (tuple, list) instead of just list, and more importantly supporting IfcPropertyListValue. Is this something you'd perhaps like to contribute to? |
Beta Was this translation helpful? Give feedback.
-
Yes this is somewhat unfortunate naming, but api.create_entity() is not intended for arbitrary classes, see the note here: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py#L27-L29
This is exactly what the template provides. It basically represents the page you see here https://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/Pset_Address.htm with
i.e IfcPropertyListValue of IfcLabel in computer interpretable form. See below:
|
Beta Was this translation helpful? Give feedback.
-
I'm experimenting on generating ifc models, currently I'm stuck at adding an address to a building, this is what I'm trying to do:
When
AddressLines
is a tuple, I'm gettingRecursionError: maximum recursion depth exceeded in comparison
, when it's a list, I'm gettingAttributeError: 'NoneType' object has no attribute 'HasPropertyTemplates'
. If I set it to a string, it works, but doesn't appear to be correct according to building smart, correct me if I'm wrong.So my question is, am I doing it wrong, or is there a bug? Or maybe I must define my own
pset_template
?Beta Was this translation helpful? Give feedback.
All reactions