mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
New print object placement debug feature
This commit is contained in:
@@ -3,6 +3,7 @@ from . import ui, prop, operator
|
|||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
operator.PrintIfcFile,
|
operator.PrintIfcFile,
|
||||||
|
operator.PrintObjectPlacement,
|
||||||
operator.ValidateIfcFile,
|
operator.ValidateIfcFile,
|
||||||
operator.ProfileImportIFC,
|
operator.ProfileImportIFC,
|
||||||
operator.CreateAllShapes,
|
operator.CreateAllShapes,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import bpy
|
import bpy
|
||||||
import logging
|
import logging
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
|
import ifcopenshell.util.placement
|
||||||
import blenderbim.bim.import_ifc as import_ifc
|
import blenderbim.bim.import_ifc as import_ifc
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
|
|
||||||
@@ -191,3 +192,13 @@ class InspectFromObject(bpy.types.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
bpy.ops.bim.inspect_from_step_id(step_id=ifc_definition_id)
|
bpy.ops.bim.inspect_from_step_id(step_id=ifc_definition_id)
|
||||||
return {"FINISHED"}
|
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":
|
if attribute.name == "GlobalId":
|
||||||
op = row.operator("bim.select_global_id", icon="RESTRICT_SELECT_OFF", text="")
|
op = row.operator("bim.select_global_id", icon="RESTRICT_SELECT_OFF", text="")
|
||||||
op.global_id = attribute.string_value
|
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:
|
if attribute.int_value:
|
||||||
row.operator(
|
row.operator(
|
||||||
"bim.inspect_from_step_id", icon="DISCLOSURE_TRI_RIGHT", text=""
|
"bim.inspect_from_step_id", icon="DISCLOSURE_TRI_RIGHT", text=""
|
||||||
|
|||||||
Reference in New Issue
Block a user