mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
bim.edit_container_attributes - remove deprecated operator
Currently you can edit container name directly from spatial manager, so this operator is no longer needed (and it also was missing from UI either way).
This commit is contained in:
@@ -26,7 +26,6 @@ classes = (
|
||||
operator.DeleteContainer,
|
||||
operator.DereferenceStructure,
|
||||
operator.DisableEditingContainer,
|
||||
operator.EditContainerAttributes,
|
||||
operator.EnableEditingContainer,
|
||||
operator.ExpandContainer,
|
||||
operator.ImportSpatialDecomposition,
|
||||
|
||||
@@ -242,17 +242,6 @@ class ImportSpatialDecomposition(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class EditContainerAttributes(bpy.types.Operator):
|
||||
bl_idname = "bim.edit_container_attributes"
|
||||
bl_label = "Edit container attributes"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
container: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
core.edit_container_attributes(tool.Spatial, entity=tool.Ifc.get().by_id(self.container))
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class ContractContainer(bpy.types.Operator):
|
||||
bl_idname = "bim.contract_container"
|
||||
bl_label = "Contract Container"
|
||||
|
||||
@@ -121,11 +121,6 @@ def import_spatial_decomposition(spatial: tool.Spatial) -> None:
|
||||
spatial.import_spatial_decomposition()
|
||||
|
||||
|
||||
def edit_container_attributes(spatial: tool.Spatial, entity: ifcopenshell.entity_instance) -> None:
|
||||
spatial.edit_container_attributes(entity)
|
||||
spatial.import_spatial_decomposition()
|
||||
|
||||
|
||||
def contract_container(spatial: tool.Spatial, container: ifcopenshell.entity_instance) -> None:
|
||||
spatial.contract_container(container)
|
||||
spatial.import_spatial_decomposition()
|
||||
|
||||
@@ -901,7 +901,6 @@ class Spatial:
|
||||
def deselect_objects(cls): pass
|
||||
def disable_editing(cls, obj): pass
|
||||
def duplicate_object_and_data(cls, obj): pass
|
||||
def edit_container_attributes(cls, entity): pass
|
||||
def edit_container_name(cls, container, name): pass
|
||||
def enable_editing(cls, obj): pass
|
||||
def expand_container(cls, container): pass
|
||||
|
||||
@@ -479,15 +479,6 @@ class Spatial(bonsai.core.tool.Spatial):
|
||||
for child in children or []:
|
||||
cls.import_spatial_element(child, level_index + 1)
|
||||
|
||||
@classmethod
|
||||
def edit_container_attributes(cls, entity: ifcopenshell.entity_instance) -> None:
|
||||
# TODO
|
||||
obj = tool.Ifc.get_object(entity)
|
||||
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
|
||||
name = bpy.context.scene.BIMSpatialDecompositionProperties.container_name
|
||||
if name != entity.Name:
|
||||
cls.edit_container_name(entity, name)
|
||||
|
||||
@classmethod
|
||||
def edit_container_name(cls, container: ifcopenshell.entity_instance, name: str) -> None:
|
||||
tool.Ifc.run("attribute.edit_attributes", product=container, attributes={"Name": name})
|
||||
|
||||
Reference in New Issue
Block a user