IfcOpenShell: Code example not working
Code example "Get the classification of an element" from here https://blenderbim.org/docs-python/ifcopenshell-python/code_examples.html is not working for me.
Get this error " import ifcopenshell.util.attribute ModuleNotFoundError: No module named 'ifcopenshell.util.attribute'"
How can I retrieve classification of an element?
Tagged:
Comments
Without seeing the code, it's hard to troubleshoot.
I've attached a similar working example. Perhaps that will help catch what was wrong.
Maybe something like this?
I don't know about that module, maybe @Moult has better ideas then my code.
You don't need ifcopenshell.util.attribute to get the classification, as shown in the example https://blenderbim.org/docs-python/ifcopenshell-python/code_examples.html#get-the-classification-of-an-element you need to import ifcopenshell.util.classification.
If importing doesn't work for you, then we need to ask how you installed IfcOpenShell. Make sure you follow the instructions at https://blenderbim.org/docs-python/ifcopenshell-python/installation.html
I'm wondering if ifcopenshell.util.classification should also work in regular Python (without Blender?)
At the moment I can import ifcopenshell to Python but can not import ifcopenshell.util.classification
Yes, it should work without Blender. Almost everything in ifcopenshell can be used without Blender. How did you install ifcopenshell? It sounds like an installation issue.
I installed with cmd using "pip install ifcopenshell"
Uninstalling ifcopenshell and then installing from zip file worked. Thank you
Or something like this. An object can contain multiple classifications. Only tested for IFC2X3TC1
Or something like this. An object can contain multiple classifications. Only tested for IFC2X3TC1
added relevant tag & software to subject line
you can see other posts tagged with IfcOpenShell here:
https://community.osarch.org/discussions/tagged/ifcopenshell