mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 11:42:45 +00:00
Potentially risky refactor of add_representation in preparation of stabilisation and optimization of geometric operators.
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user