mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
ifc array modifier: adds the option to get the dimensions from the 3d cursor
This commit is contained in:
committed by
Dion Moult
parent
0c85e26950
commit
699c692f6c
@@ -47,6 +47,9 @@ classes = (
|
||||
array.EnableEditingArray,
|
||||
array.RemoveArray,
|
||||
array.SelectArrayParent,
|
||||
array.Input3DCursorXArray,
|
||||
array.Input3DCursorYArray,
|
||||
array.Input3DCursorZArray,
|
||||
product.AddConstrTypeInstance,
|
||||
product.AddEmptyType,
|
||||
product.AlignProduct,
|
||||
|
||||
@@ -175,3 +175,42 @@ class SelectArrayParent(bpy.types.Operator):
|
||||
context.view_layer.objects.active = obj
|
||||
obj.select_set(True)
|
||||
return {"FINISHED"}
|
||||
|
||||
class Input3DCursorXArray(bpy.types.Operator):
|
||||
bl_idname = "bim.input_cursor_x_array"
|
||||
bl_label = "Get 3d Cursor X Input for Array"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
def execute(self, context):
|
||||
obj = context.active_object
|
||||
#element = tool.Ifc.get_entity(obj)
|
||||
props = obj.BIMArrayProperties
|
||||
cursor_location = context.scene.cursor.location
|
||||
props.x = cursor_location.x - obj.location.x
|
||||
return {"FINISHED"}
|
||||
|
||||
class Input3DCursorYArray(bpy.types.Operator):
|
||||
bl_idname = "bim.input_cursor_y_array"
|
||||
bl_label = "Get 3d Cursor Y Input for Array"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
def execute(self, context):
|
||||
obj = context.active_object
|
||||
#element = tool.Ifc.get_entity(obj)
|
||||
props = obj.BIMArrayProperties
|
||||
cursor_location = context.scene.cursor.location
|
||||
props.y = cursor_location.y - obj.location.y
|
||||
return {"FINISHED"}
|
||||
|
||||
class Input3DCursorZArray(bpy.types.Operator):
|
||||
bl_idname = "bim.input_cursor_z_array"
|
||||
bl_label = "Get 3d Cursor Z Input for Array"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
def execute(self, context):
|
||||
obj = context.active_object
|
||||
#element = tool.Ifc.get_entity(obj)
|
||||
props = obj.BIMArrayProperties
|
||||
cursor_location = context.scene.cursor.location
|
||||
props.z = cursor_location.z - obj.location.z
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -227,10 +227,17 @@ class BIM_PT_array(bpy.types.Panel):
|
||||
row.prop(props, "dimension_input_type")
|
||||
row = box.row(align=True)
|
||||
row.prop(props, "use_local_space")
|
||||
row = box.row(align=True)
|
||||
#row = box.row(align=True)
|
||||
col = box.column()
|
||||
row = col.row(align=True)
|
||||
row.prop(props, "x")
|
||||
row.operator("bim.input_cursor_x_array", icon="CURSOR", text="")
|
||||
row = col.row(align=True)
|
||||
row.prop(props, "y")
|
||||
row.operator("bim.input_cursor_y_array", icon="CURSOR", text="")
|
||||
row = col.row(align=True)
|
||||
row.prop(props, "z")
|
||||
row.operator("bim.input_cursor_z_array", icon="CURSOR", text="")
|
||||
|
||||
else:
|
||||
row = box.row(align=True)
|
||||
|
||||
Reference in New Issue
Block a user