small refactor

This commit is contained in:
Andrej730
2023-10-16 16:23:48 +05:00
parent 24eb149221
commit f38952dc51
4 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -1920,7 +1920,7 @@ class IfcImporter:
def link_element(self, element, obj):
self.added_data[element.id()] = obj
IfcStore.link_element(element, obj)
tool.Ifc.link(element, obj)
def set_matrix_world(self, obj, matrix_world):
obj.matrix_world = matrix_world
@@ -18,12 +18,10 @@
import bpy
import ifcopenshell.api
import blenderbim.core.spatial
import blenderbim.tool as tool
from bpy.types import Operator
from bpy.props import FloatProperty, IntProperty
from mathutils import Vector
from blenderbim.bim.ifc import IfcStore
def add_object(self, context):
@@ -66,7 +64,7 @@ def add_object(self, context):
tool.Ifc.get(),
**{"axis_tag": tag, "uvw_axes": "UAxes", "grid": grid},
)
IfcStore.link_element(result, obj)
tool.Ifc.link(result, obj)
ifcopenshell.api.run("grid.create_axis_curve", tool.Ifc.get(), **{"axis_curve": obj, "grid_axis": result})
obj.BIMObjectProperties.ifc_definition_id = result.id()
@@ -91,7 +89,7 @@ def add_object(self, context):
tool.Ifc.get(),
**{"axis_tag": tag, "uvw_axes": "VAxes", "grid": grid},
)
IfcStore.link_element(result, obj)
tool.Ifc.link(result, obj)
ifcopenshell.api.run("grid.create_axis_curve", tool.Ifc.get(), **{"axis_curve": obj, "grid_axis": result})
obj.BIMObjectProperties.ifc_definition_id = result.id()
@@ -107,7 +107,7 @@ class ReassignClass(bpy.types.Operator):
},
)
obj.name = "{}/{}".format(product.is_a(), getattr(product, "Name", "None"))
IfcStore.link_element(product, obj)
tool.Ifc.link(product, obj)
obj.BIMObjectProperties.is_reassigning_class = False
return {"FINISHED"}
@@ -180,7 +180,7 @@ class UnlinkObject(bpy.types.Operator):
obj = obj_copy
if obj in IfcStore.edited_objs:
IfcStore.edited_objs.remove(obj)
IfcStore.unlink_element(obj=obj)
tool.Ifc.unlink_element(obj=obj)
if obj.data:
obj.data = obj.data.copy()
for material_slot in obj.material_slots:
@@ -137,7 +137,7 @@ class RemoveOpening(bpy.types.Operator, tool.Ifc.Operator):
if opening_obj:
opening_obj.name = "/".join(opening_obj.name.split("/")[1:])
IfcStore.unlink_element(obj=opening_obj)
tool.Ifc.unlink(obj=opening_obj)
ifcopenshell.api.run("void.remove_opening", tool.Ifc.get(), opening=opening)