Potentially risky refactor of add_representation in preparation of stabilisation and optimization of geometric operators.

This commit is contained in:
Dion Moult
2021-10-18 19:23:40 +11:00
parent 33f4461a87
commit 4577b7bf60
16 changed files with 561 additions and 97 deletions
@@ -32,6 +32,7 @@ import blenderbim.core.owner
from blenderbim.bim.ifc import IfcStore
from blenderbim.bim import import_ifc
from blenderbim.bim import export_ifc
from ifcopenshell.api.context.data import Data as ContextData
class CreateProject(bpy.types.Operator):
@@ -76,7 +77,7 @@ class CreateProject(bpy.types.Operator):
model = blenderbim.core.context.add_context(
tool.Ifc, context_type="Model", context_identifier="", target_view="", parent=0
)
blenderbim.core.context.add_context(
body_context = blenderbim.core.context.add_context(
tool.Ifc, context_type="Model", context_identifier="Body", target_view="MODEL_VIEW", parent=model
)
blenderbim.core.context.add_context(
@@ -89,9 +90,8 @@ class CreateProject(bpy.types.Operator):
tool.Ifc, context_type="Plan", context_identifier="Annotation", target_view="PLAN_VIEW", parent=plan
)
context.scene.BIMProperties.contexts = str(
ifcopenshell.util.representation.get_context(self.file, "Model", "Body", "MODEL_VIEW").id()
)
ContextData.load(tool.Ifc.get())
context.scene.BIMProperties.contexts = str(body_context.id())
bpy.ops.bim.assign_class(obj=site.name, ifc_class="IfcSite")
bpy.ops.bim.assign_class(obj=building.name, ifc_class="IfcBuilding")