New print object placement debug feature

This commit is contained in:
Dion Moult
2021-07-19 20:16:47 +10:00
parent e68c57e9ef
commit 7cb163efef
3 changed files with 15 additions and 0 deletions
@@ -3,6 +3,7 @@ from . import ui, prop, operator
classes = (
operator.PrintIfcFile,
operator.PrintObjectPlacement,
operator.ValidateIfcFile,
operator.ProfileImportIFC,
operator.CreateAllShapes,
@@ -1,6 +1,7 @@
import bpy
import logging
import ifcopenshell
import ifcopenshell.util.placement
import blenderbim.bim.import_ifc as import_ifc
from blenderbim.bim.ifc import IfcStore
@@ -191,3 +192,13 @@ class InspectFromObject(bpy.types.Operator):
return {"FINISHED"}
bpy.ops.bim.inspect_from_step_id(step_id=ifc_definition_id)
return {"FINISHED"}
class PrintObjectPlacement(bpy.types.Operator):
bl_idname = "bim.print_object_placement"
bl_label = "Print Object Placement"
step_id: bpy.props.IntProperty()
def execute(self, context):
print(ifcopenshell.util.placement.get_local_placement(IfcStore.get_file().by_id(self.step_id)))
return {"FINISHED"}
@@ -59,6 +59,9 @@ class BIM_PT_debug(Panel):
if attribute.name == "GlobalId":
op = row.operator("bim.select_global_id", icon="RESTRICT_SELECT_OFF", text="")
op.global_id = attribute.string_value
if attribute.name == "ObjectPlacement":
op = row.operator("bim.print_object_placement", icon="TRACKER", text="")
op.step_id = attribute.int_value
if attribute.int_value:
row.operator(
"bim.inspect_from_step_id", icon="DISCLOSURE_TRI_RIGHT", text=""