If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)
Getting OverallHeight from a IFCWindow
I wonder if somebody knows how to get OverallHeight and Width from a selected IFCWindow? I guess you first need to determine if they have these attributes. I just tried
from bpy import context as C
for ob in C.selected_objects:
print (ob.OverallHeight)
but of cource it was not that simple
Comments
I thought the name might be a custom property and used bpy.data.objects[str(obj.name)]['name']) but no luck.
Ok, I solved it kind of
gives me the height and width of all windows but the problem is that I want the user to select the windows like
but then I get AttributeError: 'Object' object has no attribute 'OverallHeight'
Hi @Max, I think the problem is that you are trying to access the IFC property through the Blender Object. You have to get the IFC entity from the Blender object first. I haven't fully tested it, but maybe this will work:
Thanks a lot, I suspected something like this. For some reason tool.Ifc.get_entity(obj) gets "None" and then AttributeError: 'NoneType' object has no attribute 'OverallHeight'
I tested with two different files, and it worked for me. Maybe it's something with the file?
I feel like a complete idiot. I downloaded the IFC from this forum but I guess it was too experimental. With a typical Revit file it worked fine. Thanks for all your help.