mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
bim.resize_to_storey - document
This commit is contained in:
@@ -95,6 +95,11 @@ class SnapSpacesTogether(bpy.types.Operator):
|
||||
class ResizeToStorey(bpy.types.Operator, tool.Ifc.Operator):
|
||||
bl_idname = "bim.resize_to_storey"
|
||||
bl_label = "Resize To Storey"
|
||||
bl_description = (
|
||||
"Change object's origin to the bottom, move object to it's storey elevation and scale object to storey height.\n"
|
||||
"Storey height is based on the provided number of storeys above object's storey.\n"
|
||||
"If object's storey is the last storey, operator will have no effect"
|
||||
)
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
total_storeys: bpy.props.IntProperty()
|
||||
|
||||
@@ -104,6 +109,11 @@ class ResizeToStorey(bpy.types.Operator, tool.Ifc.Operator):
|
||||
|
||||
def _execute(self, context):
|
||||
for obj in context.selected_objects:
|
||||
if not (element := tool.Ifc.get_entity(obj)):
|
||||
continue
|
||||
if element.HasOpenings:
|
||||
self.report({"ERROR"}, f"Object '{obj.name}', scaling is not supported.")
|
||||
continue
|
||||
core.resize_to_storey(tool.Misc, obj=obj, total_storeys=self.total_storeys)
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,11 @@ from bpy.props import (
|
||||
|
||||
|
||||
class BIMMiscProperties(PropertyGroup):
|
||||
total_storeys: IntProperty(name="Total Storeys", default=1)
|
||||
total_storeys: IntProperty(
|
||||
name="Total Storeys",
|
||||
description="Number of storeys above object's storey to take into account for resizing",
|
||||
default=1,
|
||||
)
|
||||
override_colour: FloatVectorProperty(
|
||||
name="Override Colour", subtype="COLOR", default=(1, 0, 0, 1), min=0.0, max=1.0, size=4
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user