New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IFC does not open in BB. Might be related to #4124 #4255
Comments
Here's the console output, as well, if it will help.
|
This would potentially be rather easy to fix: f = ifcopenshell.open(...)
for inst in f.by_type("IfcPlacement"):
dim = int([c for c in inst.is_a() if c.isdigit()][0])
if inst.Location is None:
inst.Location = f.createIfcCartesianPoint([0.] * dim)
f.write(...) |
In this case it's 1 IfcAxis2Placement3D element and @theoryshaw you can run snippet below from Blender scripting tab and it will manually fix the problem and file will load. import ifcopenshell
filepath = r"C:\Restaurant_Pewaukee - Copy.ifc"
f = ifcopenshell.open(filepath)
for inst in f.by_type("IfcPlacement"):
if inst.Location is None:
inst.Location = f.createIfcCartesianPoint([0.] * 3)
f.write(filepath) The problem was with just 1 placement element not having location (though it's not optional). This placement is part of Body/Tessellation representation of element |
Thanks Guys, this script seems to work.
Unfortunately nothing comes to mind. I'll keep my eyes open, if this happens again. |
This happened again, unfort. @Andrej730 I use VScode, so I can try to do it on my side to figure out what object(s) it is, and it might jog my memory as what I might have 'did to it' to have it lose its coordinates. |
Did you debug while running the script? or while opening the file? |
Prior to finding https://github.com/hextantstudios/hextant_python_debugger I usually would put a Another note that typically many errors like this when something is missing some IFC attribute occur due invalid IFC file - it's possible to run the validation and search the either for missing attribute or for some entity name (e.g. "Placement") and find something related.
|
Similar to #4124 the following IFC does not open in BB. It might be related.
It 'acts' like it opens, but nothing is in the outliner.
file: https://www.dropbox.com/scl/fi/p4y4uu1qiiqgescpxglqv/Restaurant_Pewaukee.ifc?rlkey=yhktwk5urs70xu5zpcy7265sc&dl=1
The text was updated successfully, but these errors were encountered: