mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
First attempt at ripping out agnostic code into ifcopenshell.api namespace. See #1399.
This commit is contained in:
@@ -7,6 +7,7 @@ import zipfile
|
||||
import tempfile
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.placement
|
||||
import ifcopenshell.api.root.remove_product as remove_product
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
import addon_utils
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import json
|
||||
import blenderbim.bim.decoration as decoration
|
||||
from bpy.app.handlers import persistent
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.attribute.data import Data as AttributeData
|
||||
from ifcopenshell.api.attribute.data import Data as AttributeData
|
||||
|
||||
|
||||
def mode_callback(obj, data):
|
||||
@@ -28,7 +28,7 @@ def name_callback(obj, data):
|
||||
if not element.is_a("IfcRoot"):
|
||||
return
|
||||
element.Name = "/".join(obj.name.split("/")[1:])
|
||||
AttributeData.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
AttributeData.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
|
||||
|
||||
def subscribe_to(object, data_path, callback):
|
||||
|
||||
@@ -21,7 +21,6 @@ import numpy as np
|
||||
from pathlib import Path
|
||||
from itertools import cycle
|
||||
from datetime import datetime
|
||||
from blenderbim.bim.module.context.data import Data as ContextData
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from . import schema
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import bpy
|
||||
import blenderbim.bim.module.aggregate.assign_object as assign_object
|
||||
import ifcopenshell.api.aggregate.assign_object as assign_object
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.aggregate.data import Data
|
||||
from ifcopenshell.api.aggregate.data import Data
|
||||
|
||||
|
||||
class AssignObject(bpy.types.Operator):
|
||||
@@ -26,7 +26,7 @@ class AssignObject(bpy.types.Operator):
|
||||
},
|
||||
).execute()
|
||||
bpy.ops.bim.edit_object_placement(obj=related_object.name)
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
bpy.ops.bim.disable_editing_aggregate(obj=related_object.name)
|
||||
|
||||
spatial_collection = bpy.data.collections.get(related_object.name)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.aggregate.data import Data
|
||||
from ifcopenshell.api.aggregate.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class BIM_PT_aggregate(Panel):
|
||||
if not IfcStore.get_file().by_id(props.ifc_definition_id).is_a("IfcObjectDefinition"):
|
||||
return False
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
if not Data.products[props.ifc_definition_id]:
|
||||
return False
|
||||
return True
|
||||
@@ -29,7 +29,7 @@ class BIM_PT_aggregate(Panel):
|
||||
if not props.ifc_definition_id:
|
||||
return
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
|
||||
if props.is_editing_aggregate:
|
||||
row = self.layout.row(align=True)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import bpy
|
||||
import json
|
||||
import ifcopenshell
|
||||
import blenderbim.bim.module.attribute.edit_attributes as edit_attributes
|
||||
import ifcopenshell.api.attribute.edit_attributes as edit_attributes
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.attribute.data import Data
|
||||
from ifcopenshell.api.attribute.data import Data
|
||||
|
||||
|
||||
class EnableEditingAttributes(bpy.types.Operator):
|
||||
@@ -105,7 +105,7 @@ class EditAttributes(bpy.types.Operator):
|
||||
if collection:
|
||||
collection.name = new_name
|
||||
obj.name = new_name
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
bpy.ops.bim.disable_editing_attributes(obj=obj.name, obj_type=self.obj_type)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import bpy
|
||||
import blenderbim.bim.schema # refactor
|
||||
from blenderbim.bim.module.material.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.prop import StrProperty, Attribute
|
||||
from bpy.types import PropertyGroup
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.attribute.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from ifcopenshell.api.attribute.data import Data
|
||||
|
||||
|
||||
def draw_ui(context, layout, obj_type):
|
||||
@@ -7,7 +8,7 @@ def draw_ui(context, layout, obj_type):
|
||||
oprops = obj.BIMObjectProperties
|
||||
props = obj.BIMAttributeProperties
|
||||
if oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
|
||||
if props.is_editing_attributes:
|
||||
row = layout.row(align=True)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import bpy
|
||||
from blenderbim.bim.prop import StrProperty, Attribute
|
||||
from blenderbim.bim.module.owner.data import Data
|
||||
from bpy.types import PropertyGroup
|
||||
from bpy.props import (
|
||||
PointerProperty,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import bpy
|
||||
import json
|
||||
import blenderbim.bim.module.classification.add_classification as add_classification
|
||||
import blenderbim.bim.module.classification.remove_classification as remove_classification
|
||||
import blenderbim.bim.module.classification.edit_classification as edit_classification
|
||||
import blenderbim.bim.module.classification.add_reference as add_reference
|
||||
import blenderbim.bim.module.classification.remove_reference as remove_reference
|
||||
import blenderbim.bim.module.classification.edit_reference as edit_reference
|
||||
import ifcopenshell.api.classification.add_classification as add_classification
|
||||
import ifcopenshell.api.classification.remove_classification as remove_classification
|
||||
import ifcopenshell.api.classification.edit_classification as edit_classification
|
||||
import ifcopenshell.api.classification.add_reference as add_reference
|
||||
import ifcopenshell.api.classification.remove_reference as remove_reference
|
||||
import ifcopenshell.api.classification.edit_reference as edit_reference
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.classification.data import Data
|
||||
from ifcopenshell.api.classification.data import Data
|
||||
from blenderbim.bim.module.classification.prop import getClassifications, getReferences
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class AddClassification(bpy.types.Operator):
|
||||
add_classification.Usecase(
|
||||
IfcStore.get_file(), {"classification": Data.library_file.by_id(int(props.available_classifications))}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class RemoveClassification(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
self.file = IfcStore.get_file()
|
||||
remove_classification.Usecase(self.file, {"classification": self.file.by_id(self.classification)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class EditClassification(bpy.types.Operator):
|
||||
edit_classification.Usecase(
|
||||
self.file, {"classification": self.file.by_id(props.active_classification_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.disable_editing_classification()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -159,8 +159,8 @@ class RemoveClassificationReference(bpy.types.Operator):
|
||||
"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id),
|
||||
},
|
||||
).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ class EditClassificationReference(bpy.types.Operator):
|
||||
edit_reference.Usecase(
|
||||
self.file, {"reference": self.file.by_id(props.active_reference_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.disable_editing_classification_reference()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -214,8 +214,8 @@ class AddClassificationReference(bpy.types.Operator):
|
||||
"classification": classification
|
||||
},
|
||||
).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from blenderbim.bim.prop import StrProperty, Attribute
|
||||
from blenderbim.bim.module.classification.data import Data
|
||||
from ifcopenshell.api.classification.data import Data
|
||||
from bpy.types import PropertyGroup
|
||||
from bpy.props import (
|
||||
PointerProperty,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from bpy.types import Panel, UIList
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.classification.data import Data
|
||||
from ifcopenshell.api.classification.data import Data
|
||||
|
||||
|
||||
class BIM_PT_classifications(Panel):
|
||||
@@ -17,7 +17,7 @@ class BIM_PT_classifications(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
self.props = context.scene.BIMClassificationProperties
|
||||
|
||||
@@ -79,9 +79,9 @@ class BIM_PT_classification_references(Panel):
|
||||
self.props = obj.BIMClassificationReferenceProperties
|
||||
self.file = IfcStore.get_file()
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
if self.oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(self.oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id)
|
||||
|
||||
self.draw_add_ui()
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import bpy
|
||||
import json
|
||||
import ifcopenshell.util.attribute
|
||||
import blenderbim.bim.module.constraint.add_objective as add_objective
|
||||
import blenderbim.bim.module.constraint.edit_objective as edit_objective
|
||||
import blenderbim.bim.module.constraint.remove_constraint as remove_constraint
|
||||
import blenderbim.bim.module.constraint.assign_constraint as assign_constraint
|
||||
import blenderbim.bim.module.constraint.unassign_constraint as unassign_constraint
|
||||
import ifcopenshell.api.constraint.add_objective as add_objective
|
||||
import ifcopenshell.api.constraint.edit_objective as edit_objective
|
||||
import ifcopenshell.api.constraint.remove_constraint as remove_constraint
|
||||
import ifcopenshell.api.constraint.assign_constraint as assign_constraint
|
||||
import ifcopenshell.api.constraint.unassign_constraint as unassign_constraint
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.constraint.data import Data
|
||||
from ifcopenshell.api.constraint.data import Data
|
||||
|
||||
|
||||
class LoadObjectives(bpy.types.Operator):
|
||||
@@ -84,7 +84,7 @@ class AddObjective(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
result = add_objective.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_objectives()
|
||||
bpy.ops.bim.enable_editing_constraint(constraint=result.id())
|
||||
return {"FINISHED"}
|
||||
@@ -108,7 +108,7 @@ class EditObjective(bpy.types.Operator):
|
||||
edit_objective.Usecase(
|
||||
self.file, {"objective": self.file.by_id(props.active_constraint_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_objectives()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -122,7 +122,7 @@ class RemoveConstraint(bpy.types.Operator):
|
||||
props = context.scene.BIMConstraintProperties
|
||||
self.file = IfcStore.get_file()
|
||||
remove_constraint.Usecase(self.file, {"constraint": self.file.by_id(self.constraint)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
if props.is_editing == "IfcObjective":
|
||||
bpy.ops.bim.load_objectives()
|
||||
return {"FINISHED"}
|
||||
@@ -167,7 +167,7 @@ class AssignConstraint(bpy.types.Operator):
|
||||
"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id),
|
||||
"constraint": self.file.by_id(self.constraint)
|
||||
}).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -184,5 +184,5 @@ class UnassignConstraint(bpy.types.Operator):
|
||||
"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id),
|
||||
"constraint": self.file.by_id(self.constraint)
|
||||
}).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from bpy.types import Panel, UIList
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.constraint.data import Data
|
||||
from ifcopenshell.api.constraint.data import Data
|
||||
|
||||
|
||||
class BIM_PT_constraints(Panel):
|
||||
@@ -17,7 +17,7 @@ class BIM_PT_constraints(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
self.props = context.scene.BIMConstraintProperties
|
||||
|
||||
@@ -73,9 +73,9 @@ class BIM_PT_object_constraints(Panel):
|
||||
self.props = obj.BIMObjectConstraintProperties
|
||||
self.file = IfcStore.get_file()
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
if self.oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(self.oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id)
|
||||
|
||||
self.draw_add_ui()
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import bpy
|
||||
import blenderbim.bim.module.context.add_context as add_context
|
||||
import blenderbim.bim.module.context.remove_context as remove_context
|
||||
import ifcopenshell.api.context.add_context as add_context
|
||||
import ifcopenshell.api.context.remove_context as remove_context
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.context.data import Data
|
||||
from ifcopenshell.api.context.data import Data
|
||||
|
||||
|
||||
class AddSubcontext(bpy.types.Operator):
|
||||
@@ -22,7 +22,7 @@ class AddSubcontext(bpy.types.Operator):
|
||||
"target_view": self.target_view or bpy.context.scene.BIMProperties.available_target_views,
|
||||
},
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -35,5 +35,5 @@ class RemoveSubcontext(bpy.types.Operator):
|
||||
self.file = IfcStore.get_file()
|
||||
usecase = remove_context.Usecase(self.file, {"context": self.file.by_id(self.ifc_definition_id)})
|
||||
usecase.execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.context.data import Data
|
||||
from ifcopenshell.api.context.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class BIM_PT_context(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
props = context.scene.BIMProperties
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import bpy
|
||||
import json
|
||||
import ifcopenshell.util.attribute
|
||||
import blenderbim.bim.module.document.add_information as add_information
|
||||
import blenderbim.bim.module.document.add_reference as add_reference
|
||||
import blenderbim.bim.module.document.edit_information as edit_information
|
||||
import blenderbim.bim.module.document.edit_reference as edit_reference
|
||||
import blenderbim.bim.module.document.remove_document as remove_document
|
||||
import blenderbim.bim.module.document.assign_document as assign_document
|
||||
import blenderbim.bim.module.document.unassign_document as unassign_document
|
||||
import ifcopenshell.api.document.add_information as add_information
|
||||
import ifcopenshell.api.document.add_reference as add_reference
|
||||
import ifcopenshell.api.document.edit_information as edit_information
|
||||
import ifcopenshell.api.document.edit_reference as edit_reference
|
||||
import ifcopenshell.api.document.remove_document as remove_document
|
||||
import ifcopenshell.api.document.assign_document as assign_document
|
||||
import ifcopenshell.api.document.unassign_document as unassign_document
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.document.data import Data
|
||||
from ifcopenshell.api.document.data import Data
|
||||
|
||||
|
||||
class LoadInformation(bpy.types.Operator):
|
||||
@@ -117,7 +117,7 @@ class AddInformation(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
result = add_information.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_information()
|
||||
bpy.ops.bim.enable_editing_document(document=result.id())
|
||||
return {"FINISHED"}
|
||||
@@ -129,7 +129,7 @@ class AddDocumentReference(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
result = add_reference.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_document_references()
|
||||
bpy.ops.bim.enable_editing_document(document=result.id())
|
||||
return {"FINISHED"}
|
||||
@@ -153,7 +153,7 @@ class EditInformation(bpy.types.Operator):
|
||||
edit_information.Usecase(
|
||||
self.file, {"information": self.file.by_id(props.active_document_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_information()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -174,7 +174,7 @@ class EditDocumentReference(bpy.types.Operator):
|
||||
edit_reference.Usecase(
|
||||
self.file, {"reference": self.file.by_id(props.active_document_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_document_references()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -188,7 +188,7 @@ class RemoveDocument(bpy.types.Operator):
|
||||
props = context.scene.BIMDocumentProperties
|
||||
self.file = IfcStore.get_file()
|
||||
remove_document.Usecase(self.file, {"document": self.file.by_id(self.document)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
if props.is_editing == "information":
|
||||
bpy.ops.bim.load_information()
|
||||
elif props.is_editing == "reference":
|
||||
@@ -237,7 +237,7 @@ class AssignDocument(bpy.types.Operator):
|
||||
"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id),
|
||||
"document": self.file.by_id(self.document)
|
||||
}).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -254,5 +254,5 @@ class UnassignDocument(bpy.types.Operator):
|
||||
"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id),
|
||||
"document": self.file.by_id(self.document)
|
||||
}).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from bpy.types import Panel, UIList
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.document.data import Data
|
||||
from ifcopenshell.api.document.data import Data
|
||||
|
||||
|
||||
class BIM_PT_documents(Panel):
|
||||
@@ -17,7 +17,7 @@ class BIM_PT_documents(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
self.props = context.scene.BIMDocumentProperties
|
||||
|
||||
@@ -77,9 +77,9 @@ class BIM_PT_object_documents(Panel):
|
||||
self.props = obj.BIMObjectDocumentProperties
|
||||
self.file = IfcStore.get_file()
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
if self.oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(self.oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id)
|
||||
|
||||
self.draw_add_ui()
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import subprocess
|
||||
import webbrowser
|
||||
from blenderbim.bim.operator import open_with_user_command
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.group.data import Data as GroupData
|
||||
from blenderbim.bim.module.pset.data import Data as PsetData
|
||||
from ifcopenshell.api.group.data import Data as GroupData
|
||||
from ifcopenshell.api.pset.data import Data as PsetData
|
||||
|
||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
@@ -4,19 +4,19 @@ import ifcopenshell
|
||||
import ifcopenshell.util.unit
|
||||
import ifcopenshell.util.element
|
||||
import logging
|
||||
import blenderbim.bim.module.geometry.edit_object_placement as edit_object_placement
|
||||
import blenderbim.bim.module.geometry.add_representation as add_representation
|
||||
import blenderbim.bim.module.geometry.map_representation as map_representation
|
||||
import blenderbim.bim.module.geometry.assign_styles as assign_styles
|
||||
import blenderbim.bim.module.geometry.assign_representation as assign_representation
|
||||
import blenderbim.bim.module.geometry.unassign_representation as unassign_representation
|
||||
import blenderbim.bim.module.geometry.remove_representation as remove_representation
|
||||
import blenderbim.bim.module.grid.create_axis_curve as create_axis_curve
|
||||
import ifcopenshell.api.geometry.edit_object_placement as edit_object_placement
|
||||
import ifcopenshell.api.geometry.add_representation as add_representation
|
||||
import ifcopenshell.api.geometry.map_representation as map_representation
|
||||
import ifcopenshell.api.geometry.assign_styles as assign_styles
|
||||
import ifcopenshell.api.geometry.assign_representation as assign_representation
|
||||
import ifcopenshell.api.geometry.unassign_representation as unassign_representation
|
||||
import ifcopenshell.api.geometry.remove_representation as remove_representation
|
||||
import ifcopenshell.api.grid.create_axis_curve as create_axis_curve
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim import import_ifc
|
||||
from blenderbim.bim.module.geometry.data import Data
|
||||
from blenderbim.bim.module.context.data import Data as ContextData
|
||||
from blenderbim.bim.module.void.data import Data as VoidData
|
||||
from ifcopenshell.api.geometry.data import Data
|
||||
from ifcopenshell.api.context.data import Data as ContextData
|
||||
from ifcopenshell.api.void.data import Data as VoidData
|
||||
from mathutils import Vector
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class AddRepresentation(bpy.types.Operator):
|
||||
mesh.name = "{}/{}".format(context_id, result.id())
|
||||
mesh.BIMMeshProperties.ifc_definition_id = int(result.id())
|
||||
obj.data = mesh
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ class SwitchRepresentation(bpy.types.Operator):
|
||||
|
||||
if self.disable_opening_subtractions and self.context_of_items.ContextIdentifier == "Body":
|
||||
if self.oprops.ifc_definition_id not in VoidData.products:
|
||||
VoidData.load(self.oprops.ifc_definition_id)
|
||||
VoidData.load(IfcStore.get_file(), self.oprops.ifc_definition_id)
|
||||
for opening_id in VoidData.products[self.oprops.ifc_definition_id]:
|
||||
if opening_id in IfcStore.id_map:
|
||||
opening = IfcStore.id_map[opening_id]
|
||||
@@ -213,7 +213,6 @@ class RemoveRepresentation(bpy.types.Operator):
|
||||
self.file = IfcStore.get_file()
|
||||
representation = self.file.by_id(self.representation_id)
|
||||
obj = bpy.data.objects.get(self.obj) if self.obj else bpy.context.active_object
|
||||
product = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
is_mapped_representation = representation.RepresentationType == "MappedRepresentation"
|
||||
if is_mapped_representation:
|
||||
mesh_name = "{}/{}".format(
|
||||
@@ -234,7 +233,7 @@ class RemoveRepresentation(bpy.types.Operator):
|
||||
product = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
unassign_representation.Usecase(self.file, {"product": product, "representation": representation}).execute()
|
||||
remove_representation.Usecase(self.file, {"representation": representation}).execute()
|
||||
Data.load(product.id())
|
||||
Data.load(IfcStore.get_file(), product.id())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -248,13 +247,13 @@ class MapRepresentations(bpy.types.Operator):
|
||||
related_object = IfcStore.id_map[self.product_id]
|
||||
|
||||
if self.product_id not in Data.products:
|
||||
Data.load(self.product_id)
|
||||
Data.load(IfcStore.get_file(), self.product_id)
|
||||
|
||||
for representation_id in Data.products[self.product_id]:
|
||||
bpy.ops.bim.remove_representation(obj=related_object.name, representation_id=representation_id)
|
||||
|
||||
if self.type_product_id not in Data.products:
|
||||
Data.load(self.type_product_id)
|
||||
Data.load(IfcStore.get_file(), self.type_product_id)
|
||||
|
||||
for representation_id in Data.products[self.type_product_id]:
|
||||
bpy.ops.bim.map_representation(
|
||||
@@ -287,7 +286,7 @@ class MapRepresentation(bpy.types.Operator):
|
||||
self.file, {"representation": self.file.by_id(self.representation_id)}
|
||||
).execute()
|
||||
assign_representation.Usecase(self.file, {"product": product, "representation": result}).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -299,7 +298,7 @@ class UpdateMeshRepresentation(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
if not ContextData.is_loaded:
|
||||
ContextData.load()
|
||||
ContextData.load(IfcStore.get_file())
|
||||
|
||||
objs = [bpy.data.objects.get(self.obj)] if self.obj else bpy.context.selected_objects
|
||||
self.file = IfcStore.get_file()
|
||||
@@ -396,7 +395,7 @@ class UpdateMeshRepresentation(bpy.types.Operator):
|
||||
obj.data.BIMMeshProperties.ifc_definition_id = int(new_representation.id())
|
||||
obj.data.name = f"{old_representation.ContextOfItems.id()}/{new_representation.id()}"
|
||||
bpy.ops.bim.remove_representation(representation_id=old_representation.id())
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
|
||||
|
||||
class UpdateParametricRepresentation(bpy.types.Operator):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.geometry.data import Data
|
||||
from ifcopenshell.api.geometry.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class BIM_PT_representations(Panel):
|
||||
props = context.active_object.BIMObjectProperties
|
||||
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
|
||||
representations = Data.products[props.ifc_definition_id]
|
||||
if not representations:
|
||||
|
||||
@@ -3,11 +3,11 @@ import json
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.unit
|
||||
import ifcopenshell.util.attribute
|
||||
import blenderbim.bim.module.georeference.add_georeferencing as add_georeferencing
|
||||
import blenderbim.bim.module.georeference.edit_georeferencing as edit_georeferencing
|
||||
import blenderbim.bim.module.georeference.remove_georeferencing as remove_georeferencing
|
||||
import ifcopenshell.api.georeference.add_georeferencing as add_georeferencing
|
||||
import ifcopenshell.api.georeference.edit_georeferencing as edit_georeferencing
|
||||
import ifcopenshell.api.georeference.remove_georeferencing as remove_georeferencing
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.georeference.data import Data
|
||||
from ifcopenshell.api.georeference.data import Data
|
||||
from math import radians, degrees, atan, tan, cos, sin
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ class EditGeoreferencing(bpy.types.Operator):
|
||||
edit_georeferencing.Usecase(
|
||||
self.file, {"map_conversion": map_conversion, "projected_crs": projected_crs, "map_unit": map_unit}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.disable_editing_georeferencing()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -170,7 +170,7 @@ class RemoveGeoreferencing(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
remove_georeferencing.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ class AddGeoreferencing(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
add_georeferencing.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ class ConvertLocalToGlobal(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
props = context.scene.BIMGeoreferenceProperties
|
||||
x, y, z = [float(co) for co in props.coordinate_input.split(",")]
|
||||
|
||||
@@ -240,7 +240,7 @@ class ConvertGlobalToLocal(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
props = context.scene.BIMGeoreferenceProperties
|
||||
x, y, z = [float(co) for co in props.coordinate_input.split(",")]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.georeference.data import Data
|
||||
from ifcopenshell.api.georeference.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
class BIM_PT_gis(Panel):
|
||||
@@ -17,7 +17,7 @@ class BIM_PT_gis(Panel):
|
||||
def draw(self, context):
|
||||
props = context.scene.BIMGeoreferenceProperties
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
if props.is_editing:
|
||||
return self.draw_editable_ui(context)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import bpy
|
||||
import ifcopenshell.util.attribute
|
||||
import blenderbim.bim.module.group.add_group as add_group
|
||||
import blenderbim.bim.module.group.edit_group as edit_group
|
||||
import blenderbim.bim.module.group.remove_group as remove_group
|
||||
import blenderbim.bim.module.group.assign_group as assign_group
|
||||
import blenderbim.bim.module.group.unassign_group as unassign_group
|
||||
import ifcopenshell.api.group.add_group as add_group
|
||||
import ifcopenshell.api.group.edit_group as edit_group
|
||||
import ifcopenshell.api.group.remove_group as remove_group
|
||||
import ifcopenshell.api.group.assign_group as assign_group
|
||||
import ifcopenshell.api.group.unassign_group as unassign_group
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.group.data import Data
|
||||
from ifcopenshell.api.group.data import Data
|
||||
|
||||
|
||||
class LoadGroups(bpy.types.Operator):
|
||||
@@ -41,7 +41,7 @@ class AddGroup(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
result = add_group.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_groups()
|
||||
bpy.ops.bim.enable_editing_group(group=result.id())
|
||||
return {"FINISHED"}
|
||||
@@ -63,7 +63,7 @@ class EditGroup(bpy.types.Operator):
|
||||
edit_group.Usecase(
|
||||
self.file, {"group": self.file.by_id(props.active_group_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_groups()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -77,7 +77,7 @@ class RemoveGroup(bpy.types.Operator):
|
||||
props = context.scene.BIMGroupProperties
|
||||
self.file = IfcStore.get_file()
|
||||
remove_group.Usecase(self.file, {"group": self.file.by_id(self.group)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_groups()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -129,7 +129,7 @@ class AssignGroup(bpy.types.Operator):
|
||||
"product": self.file.by_id(product.BIMObjectProperties.ifc_definition_id),
|
||||
"group": self.file.by_id(self.group)
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -146,5 +146,5 @@ class UnassignGroup(bpy.types.Operator):
|
||||
"product": self.file.by_id(product.BIMObjectProperties.ifc_definition_id),
|
||||
"group": self.file.by_id(self.group)
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from bpy.types import Panel, UIList
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.group.data import Data
|
||||
from ifcopenshell.api.group.data import Data
|
||||
|
||||
|
||||
class BIM_PT_groups(Panel):
|
||||
@@ -17,7 +17,7 @@ class BIM_PT_groups(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
self.props = context.scene.BIMGroupProperties
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import bpy
|
||||
import json
|
||||
import ifcopenshell.util.attribute
|
||||
import blenderbim.bim.module.layer.add_layer as add_layer
|
||||
import blenderbim.bim.module.layer.edit_layer as edit_layer
|
||||
import blenderbim.bim.module.layer.remove_layer as remove_layer
|
||||
import blenderbim.bim.module.layer.assign_layer as assign_layer
|
||||
import blenderbim.bim.module.layer.unassign_layer as unassign_layer
|
||||
import ifcopenshell.api.layer.add_layer as add_layer
|
||||
import ifcopenshell.api.layer.edit_layer as edit_layer
|
||||
import ifcopenshell.api.layer.remove_layer as remove_layer
|
||||
import ifcopenshell.api.layer.assign_layer as assign_layer
|
||||
import ifcopenshell.api.layer.unassign_layer as unassign_layer
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.layer.data import Data
|
||||
from ifcopenshell.api.layer.data import Data
|
||||
|
||||
|
||||
class LoadLayers(bpy.types.Operator):
|
||||
@@ -77,7 +77,7 @@ class AddPresentationLayer(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
result = add_layer.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_layers()
|
||||
bpy.ops.bim.enable_editing_layer(layer=result.id())
|
||||
return {"FINISHED"}
|
||||
@@ -99,7 +99,7 @@ class EditPresentationLayer(bpy.types.Operator):
|
||||
edit_layer.Usecase(
|
||||
self.file, {"layer": self.file.by_id(props.active_layer_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_layers()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -113,7 +113,7 @@ class RemovePresentationLayer(bpy.types.Operator):
|
||||
props = context.scene.BIMLayerProperties
|
||||
self.file = IfcStore.get_file()
|
||||
remove_layer.Usecase(self.file, {"layer": self.file.by_id(self.layer)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_layers()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -131,7 +131,7 @@ class AssignPresentationLayer(bpy.types.Operator):
|
||||
"item": self.file.by_id(item.BIMMeshProperties.ifc_definition_id),
|
||||
"layer": self.file.by_id(self.layer)
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -148,5 +148,5 @@ class UnassignPresentationLayer(bpy.types.Operator):
|
||||
"item": self.file.by_id(item.BIMMeshProperties.ifc_definition_id),
|
||||
"layer": self.file.by_id(self.layer)
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from bpy.types import Panel, UIList, Mesh
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.layer.data import Data
|
||||
from ifcopenshell.api.layer.data import Data
|
||||
|
||||
|
||||
class BIM_PT_layers(Panel):
|
||||
@@ -17,7 +17,7 @@ class BIM_PT_layers(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
self.props = context.scene.BIMLayerProperties
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import bpy
|
||||
import ifcopenshell.util.attribute
|
||||
import blenderbim.bim.module.material.add_material as add_material
|
||||
import blenderbim.bim.module.material.remove_material as remove_material
|
||||
import blenderbim.bim.module.material.assign_material as assign_material
|
||||
import blenderbim.bim.module.material.unassign_material as unassign_material
|
||||
import blenderbim.bim.module.material.add_constituent as add_constituent
|
||||
import blenderbim.bim.module.material.remove_constituent as remove_constituent
|
||||
import blenderbim.bim.module.material.add_layer as add_layer
|
||||
import blenderbim.bim.module.material.edit_layer as edit_layer
|
||||
import blenderbim.bim.module.material.remove_layer as remove_layer
|
||||
import blenderbim.bim.module.material.reorder_set_item as reorder_set_item
|
||||
import blenderbim.bim.module.material.add_list_item as add_list_item
|
||||
import blenderbim.bim.module.material.remove_list_item as remove_list_item
|
||||
import blenderbim.bim.module.material.edit_assigned_material as edit_assigned_material
|
||||
import ifcopenshell.api.material.add_material as add_material
|
||||
import ifcopenshell.api.material.remove_material as remove_material
|
||||
import ifcopenshell.api.material.assign_material as assign_material
|
||||
import ifcopenshell.api.material.unassign_material as unassign_material
|
||||
import ifcopenshell.api.material.add_constituent as add_constituent
|
||||
import ifcopenshell.api.material.remove_constituent as remove_constituent
|
||||
import ifcopenshell.api.material.add_layer as add_layer
|
||||
import ifcopenshell.api.material.edit_layer as edit_layer
|
||||
import ifcopenshell.api.material.remove_layer as remove_layer
|
||||
import ifcopenshell.api.material.reorder_set_item as reorder_set_item
|
||||
import ifcopenshell.api.material.add_list_item as add_list_item
|
||||
import ifcopenshell.api.material.remove_list_item as remove_list_item
|
||||
import ifcopenshell.api.material.edit_assigned_material as edit_assigned_material
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.material.data import Data
|
||||
from ifcopenshell.api.material.data import Data
|
||||
|
||||
|
||||
class AddMaterial(bpy.types.Operator):
|
||||
@@ -27,7 +27,7 @@ class AddMaterial(bpy.types.Operator):
|
||||
self.file = IfcStore.get_file()
|
||||
result = add_material.Usecase(self.file, {"Name": obj.name}).execute()
|
||||
obj.BIMObjectProperties.ifc_definition_id = result.id()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class RemoveMaterial(bpy.types.Operator):
|
||||
self.file, {"material": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)}
|
||||
).execute()
|
||||
obj.BIMObjectProperties.ifc_definition_id = 0
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ class AssignMaterial(bpy.types.Operator):
|
||||
"material": self.file.by_id(int(obj.BIMObjectMaterialProperties.material)),
|
||||
},
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file())
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class UnassignMaterial(bpy.types.Operator):
|
||||
unassign_material.Usecase(
|
||||
self.file, {"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)}
|
||||
).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ class EditAssignedMaterial(bpy.types.Operator):
|
||||
if product_data["type"] == "IfcMaterial":
|
||||
bpy.ops.bim.unassign_material(obj=obj.name)
|
||||
bpy.ops.bim.assign_material(obj=obj.name, material_type="IfcMaterial")
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
bpy.ops.bim.disable_editing_assigned_material(obj=obj.name)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -312,7 +312,7 @@ class EditAssignedMaterial(bpy.types.Operator):
|
||||
"attributes": attributes,
|
||||
},
|
||||
).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
if material_set.is_a("IfcMaterialConstituentSet"):
|
||||
Data.load_constituents()
|
||||
elif material_set.is_a("IfcMaterialLayerSet"):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
import blenderbim.bim.schema # refactor
|
||||
from blenderbim.bim.module.material.data import Data
|
||||
from ifcopenshell.api.material.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.prop import StrProperty, Attribute
|
||||
from bpy.types import PropertyGroup
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.material.data import Data
|
||||
from ifcopenshell.api.material.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ class BIM_PT_object_material(Panel):
|
||||
self.oprops = context.active_object.BIMObjectProperties
|
||||
self.props = context.active_object.BIMObjectMaterialProperties
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
if self.oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(self.oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id)
|
||||
self.product_data = Data.products[self.oprops.ifc_definition_id]
|
||||
|
||||
if not Data.materials:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
import blenderbim.bim.module.grid.create_grid_axis as create_grid_axis
|
||||
import blenderbim.bim.module.grid.create_axis_curve as create_axis_curve
|
||||
import ifcopenshell.api.grid.create_grid_axis as create_grid_axis
|
||||
import ifcopenshell.api.grid.create_axis_curve as create_axis_curve
|
||||
from bpy.types import Operator
|
||||
from bpy.props import FloatProperty, IntProperty
|
||||
from mathutils import Vector
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import bpy
|
||||
import json
|
||||
import blenderbim.bim.module.owner.add_person as add_person
|
||||
import blenderbim.bim.module.owner.edit_person as edit_person
|
||||
import blenderbim.bim.module.owner.remove_person as remove_person
|
||||
import blenderbim.bim.module.owner.add_organisation as add_organisation
|
||||
import blenderbim.bim.module.owner.edit_organisation as edit_organisation
|
||||
import blenderbim.bim.module.owner.remove_organisation as remove_organisation
|
||||
import blenderbim.bim.module.owner.add_role as add_role
|
||||
import blenderbim.bim.module.owner.edit_role as edit_role
|
||||
import blenderbim.bim.module.owner.remove_role as remove_role
|
||||
import blenderbim.bim.module.owner.add_address as add_address
|
||||
import blenderbim.bim.module.owner.edit_address as edit_address
|
||||
import blenderbim.bim.module.owner.remove_address as remove_address
|
||||
import ifcopenshell.api.owner.add_person as add_person
|
||||
import ifcopenshell.api.owner.edit_person as edit_person
|
||||
import ifcopenshell.api.owner.remove_person as remove_person
|
||||
import ifcopenshell.api.owner.add_organisation as add_organisation
|
||||
import ifcopenshell.api.owner.edit_organisation as edit_organisation
|
||||
import ifcopenshell.api.owner.remove_organisation as remove_organisation
|
||||
import ifcopenshell.api.owner.add_role as add_role
|
||||
import ifcopenshell.api.owner.edit_role as edit_role
|
||||
import ifcopenshell.api.owner.remove_role as remove_role
|
||||
import ifcopenshell.api.owner.add_address as add_address
|
||||
import ifcopenshell.api.owner.edit_address as edit_address
|
||||
import ifcopenshell.api.owner.remove_address as remove_address
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.owner.data import Data
|
||||
from ifcopenshell.api.owner.data import Data
|
||||
|
||||
|
||||
class EnableEditingPerson(bpy.types.Operator):
|
||||
@@ -51,7 +51,7 @@ class AddPerson(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
add_person.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class EditPerson(bpy.types.Operator):
|
||||
edit_person.Usecase(
|
||||
self.file, {"person": self.file.by_id(props.active_person_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.disable_editing_person()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -89,7 +89,7 @@ class RemovePerson(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
self.file = IfcStore.get_file()
|
||||
remove_person.Usecase(self.file, {"person": self.file.by_id(self.person_id)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ class AddRole(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
self.file = IfcStore.get_file()
|
||||
add_role.Usecase(self.file, {"assigned_object": self.file.by_id(self.assigned_object_id)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ class EditRole(bpy.types.Operator):
|
||||
edit_role.Usecase(
|
||||
self.file, {"role": self.file.by_id(props.active_role_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.disable_editing_role()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -158,7 +158,7 @@ class RemoveRole(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
self.file = IfcStore.get_file()
|
||||
remove_role.Usecase(self.file, {"role": self.file.by_id(self.role_id)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ class AddAddress(bpy.types.Operator):
|
||||
add_address.Usecase(
|
||||
self.file, {"assigned_object": self.file.by_id(self.assigned_object_id), "ifc_class": self.ifc_class}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ class EditAddress(bpy.types.Operator):
|
||||
"Country": props.address.country or None,
|
||||
})
|
||||
edit_address.Usecase(self.file, {"address": address, "attributes": attributes}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.disable_editing_address()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -280,7 +280,7 @@ class RemoveAddress(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
self.file = IfcStore.get_file()
|
||||
remove_address.Usecase(self.file, {"address": self.file.by_id(self.address_id)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ class AddOrganisation(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
add_organisation.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ class EditOrganisation(bpy.types.Operator):
|
||||
edit_organisation.Usecase(
|
||||
self.file, {"organisation": self.file.by_id(props.active_organisation_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.disable_editing_organisation()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -351,5 +351,5 @@ class RemoveOrganisation(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
self.file = IfcStore.get_file()
|
||||
remove_organisation.Usecase(self.file, {"organisation": self.file.by_id(self.organisation_id)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from blenderbim.bim.prop import StrProperty, Attribute
|
||||
from blenderbim.bim.module.owner.data import Data
|
||||
from ifcopenshell.api.owner.data import Data
|
||||
from bpy.types import PropertyGroup
|
||||
from bpy.props import (
|
||||
PointerProperty,
|
||||
@@ -16,7 +16,7 @@ from bpy.props import (
|
||||
|
||||
def getPersons(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
results = []
|
||||
for ifc_id, person in Data.people.items():
|
||||
if "Id" in person:
|
||||
@@ -29,7 +29,7 @@ def getPersons(self, context):
|
||||
|
||||
def getOrganisations(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
results = []
|
||||
for ifc_id, organisation in Data.organisations.items():
|
||||
results.append((str(ifc_id), organisation["Name"], ""))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.owner.data import Data
|
||||
from ifcopenshell.api.owner.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class BIM_PT_people(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
self.file = IfcStore.get_file()
|
||||
self.layout.use_property_split = True
|
||||
@@ -166,7 +166,7 @@ class BIM_PT_organisations(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
self.file = IfcStore.get_file()
|
||||
self.layout.use_property_split = True
|
||||
@@ -215,7 +215,7 @@ class BIM_PT_owner(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
self.layout.use_property_split = True
|
||||
self.layout.use_property_decorate = False
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import bpy
|
||||
import logging
|
||||
import ifcopenshell
|
||||
import blenderbim.bim.module.project.create_file as create_file
|
||||
import ifcopenshell.api.project.create_file as create_file
|
||||
import bpy
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
# from blenderbim.bim.module.project.data import Data
|
||||
# from ifcopenshell.api.project.data import Data
|
||||
|
||||
|
||||
class CreateProject(bpy.types.Operator):
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import bpy
|
||||
import json
|
||||
import ifcopenshell.util.unit
|
||||
import blenderbim.bim.module.pset.add_pset as add_pset
|
||||
import blenderbim.bim.module.pset.edit_pset as edit_pset
|
||||
import blenderbim.bim.module.pset.remove_pset as remove_pset
|
||||
import blenderbim.bim.module.pset.add_qto as add_qto
|
||||
import blenderbim.bim.module.pset.edit_qto as edit_qto
|
||||
import ifcopenshell.api.pset.add_pset as add_pset
|
||||
import ifcopenshell.api.pset.edit_pset as edit_pset
|
||||
import ifcopenshell.api.pset.remove_pset as remove_pset
|
||||
import ifcopenshell.api.pset.add_qto as add_qto
|
||||
import ifcopenshell.api.pset.edit_qto as edit_qto
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.pset.data import Data
|
||||
from ifcopenshell.api.pset.data import Data
|
||||
from blenderbim.bim.module.pset.qto_calculator import QtoCalculator
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ class EditPset(bpy.types.Operator):
|
||||
"Properties": properties,
|
||||
},
|
||||
).execute()
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
bpy.ops.bim.disable_pset_editing(obj=self.obj, obj_type=self.obj_type)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -163,7 +163,7 @@ class RemovePset(bpy.types.Operator):
|
||||
"pset": self.file.by_id(self.pset_id),
|
||||
},
|
||||
).execute()
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ class AddPset(bpy.types.Operator):
|
||||
"Name": pset_name,
|
||||
},
|
||||
).execute()
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ class AddQto(bpy.types.Operator):
|
||||
"Name": props.qto_name,
|
||||
},
|
||||
).execute()
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from blenderbim.bim.prop import Attribute
|
||||
from blenderbim.bim.module.pset.data import Data
|
||||
from ifcopenshell.api.pset.data import Data
|
||||
import blenderbim.bim.schema
|
||||
from bpy.types import PropertyGroup
|
||||
from bpy.props import (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.pset.data import Data
|
||||
from ifcopenshell.api.pset.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class BIM_PT_object_psets(Panel):
|
||||
if not props.ifc_definition_id:
|
||||
return False
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
if not Data.products[props.ifc_definition_id]:
|
||||
return False
|
||||
return True
|
||||
@@ -111,7 +111,7 @@ class BIM_PT_object_psets(Panel):
|
||||
if not oprops.ifc_definition_id:
|
||||
return
|
||||
if oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
row = self.layout.row(align=True)
|
||||
row.prop(props, "pset_name", text="")
|
||||
op = row.operator("bim.add_pset", icon="ADD", text="")
|
||||
@@ -143,7 +143,7 @@ class BIM_PT_object_qtos(Panel):
|
||||
if not props.ifc_definition_id:
|
||||
return False
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
if not Data.products[props.ifc_definition_id]:
|
||||
return False
|
||||
return True
|
||||
@@ -154,7 +154,7 @@ class BIM_PT_object_qtos(Panel):
|
||||
if not oprops.ifc_definition_id:
|
||||
return
|
||||
if oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
row = self.layout.row(align=True)
|
||||
row.prop(props, "qto_name", text="")
|
||||
row.operator("bim.add_qto", icon="ADD", text="")
|
||||
@@ -183,7 +183,7 @@ class BIM_PT_material_psets(Panel):
|
||||
if IfcStore.get_file().schema == "IFC2X3":
|
||||
return False # We don't support material psets in IFC2X3 because they suck
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
if not Data.products[props.ifc_definition_id]:
|
||||
return False
|
||||
return True
|
||||
@@ -194,7 +194,7 @@ class BIM_PT_material_psets(Panel):
|
||||
if not oprops.ifc_definition_id:
|
||||
return
|
||||
if oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
row = self.layout.row(align=True)
|
||||
row.prop(props, "material_pset_name", text="")
|
||||
op = row.operator("bim.add_pset", icon="ADD", text="")
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import bpy
|
||||
import ifcopenshell
|
||||
import blenderbim.bim.module.pset_template.add_pset_template as add_pset_template
|
||||
import blenderbim.bim.module.pset_template.edit_pset_template as edit_pset_template
|
||||
import blenderbim.bim.module.pset_template.remove_pset_template as remove_pset_template
|
||||
import blenderbim.bim.module.pset_template.add_prop_template as add_prop_template
|
||||
import blenderbim.bim.module.pset_template.edit_prop_template as edit_prop_template
|
||||
import blenderbim.bim.module.pset_template.remove_prop_template as remove_prop_template
|
||||
import ifcopenshell.api.pset_template.add_pset_template as add_pset_template
|
||||
import ifcopenshell.api.pset_template.edit_pset_template as edit_pset_template
|
||||
import ifcopenshell.api.pset_template.remove_pset_template as remove_pset_template
|
||||
import ifcopenshell.api.pset_template.add_prop_template as add_prop_template
|
||||
import ifcopenshell.api.pset_template.edit_prop_template as edit_prop_template
|
||||
import ifcopenshell.api.pset_template.remove_prop_template as remove_prop_template
|
||||
from blenderbim.bim.module.pset_template.prop import updatePsetTemplateFiles, updatePsetTemplates
|
||||
from blenderbim.bim.module.pset_template.data import Data
|
||||
from ifcopenshell.api.pset_template.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class AddPsetTemplate(bpy.types.Operator):
|
||||
def execute(self, context):
|
||||
props = context.scene.BIMPsetTemplateProperties
|
||||
add_pset_template.Usecase(IfcStore.pset_template_file).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.pset_template_file)
|
||||
updatePsetTemplates(self, context)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -34,7 +34,7 @@ class RemovePsetTemplate(bpy.types.Operator):
|
||||
remove_pset_template.Usecase(IfcStore.pset_template_file, {
|
||||
"pset_template": IfcStore.pset_template_file.by_id(int(props.pset_templates))
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.pset_template_file)
|
||||
updatePsetTemplates(self, context)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -105,7 +105,7 @@ class EditPsetTemplate(bpy.types.Operator):
|
||||
"ApplicableEntity": props.active_pset_template.applicable_entity,
|
||||
}
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.pset_template_file)
|
||||
updatePsetTemplates(self, context)
|
||||
bpy.ops.bim.disable_editing_pset_template()
|
||||
return {"FINISHED"}
|
||||
@@ -130,7 +130,7 @@ class AddPropTemplate(bpy.types.Operator):
|
||||
add_prop_template.Usecase(IfcStore.pset_template_file, {
|
||||
"pset_template": IfcStore.pset_template_file.by_id(pset_template_id)
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.pset_template_file)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ class RemovePropTemplate(bpy.types.Operator):
|
||||
remove_prop_template.Usecase(IfcStore.pset_template_file, {
|
||||
"prop_template": IfcStore.pset_template_file.by_id(self.prop_template)
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.pset_template_file)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -162,6 +162,6 @@ class EditPropTemplate(bpy.types.Operator):
|
||||
"PrimaryMeasureType": props.active_prop_template.primary_measure_type,
|
||||
}
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.pset_template_file)
|
||||
bpy.ops.bim.disable_editing_prop_template()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -14,7 +14,7 @@ from bpy.props import (
|
||||
FloatVectorProperty,
|
||||
CollectionProperty,
|
||||
)
|
||||
from blenderbim.bim.module.pset_template.data import Data
|
||||
from ifcopenshell.api.pset_template.data import Data
|
||||
|
||||
|
||||
psettemplatefiles_enum = []
|
||||
@@ -58,7 +58,7 @@ def getPsetTemplates(self, context):
|
||||
IfcStore.pset_template_file = ifcopenshell.open(IfcStore.pset_template_path)
|
||||
templates = IfcStore.pset_template_file.by_type("IfcPropertySetTemplate")
|
||||
psettemplates_enum.extend([(str(t.id()), t.Name, "") for t in templates])
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return psettemplates_enum
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.pset_template.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from ifcopenshell.api.pset_template.data import Data
|
||||
|
||||
|
||||
class BIM_PT_pset_template(Panel):
|
||||
@@ -37,7 +38,7 @@ class BIM_PT_pset_template(Panel):
|
||||
# row.operator("bim.save_pset_template", text="", icon="EXPORT")
|
||||
|
||||
if not Data.is_loaded and props.pset_template_files:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
|
||||
if not Data.pset_templates:
|
||||
return
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import bpy
|
||||
from blenderbim.bim.prop import StrProperty, Attribute
|
||||
from blenderbim.bim.module.owner.data import Data
|
||||
from bpy.types import PropertyGroup
|
||||
from bpy.props import (
|
||||
PointerProperty,
|
||||
|
||||
@@ -3,11 +3,11 @@ import numpy as np
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.schema
|
||||
import ifcopenshell.util.element
|
||||
import blenderbim.bim.module.root.create_product as create_product
|
||||
import blenderbim.bim.module.root.remove_product as remove_product
|
||||
import blenderbim.bim.module.root.reassign_class as reassign_class
|
||||
import blenderbim.bim.module.root.copy_class as copy_class
|
||||
from blenderbim.bim.module.geometry.data import Data as GeometryData
|
||||
import ifcopenshell.api.root.create_product as create_product
|
||||
import ifcopenshell.api.root.remove_product as remove_product
|
||||
import ifcopenshell.api.root.reassign_class as reassign_class
|
||||
import ifcopenshell.api.root.copy_class as copy_class
|
||||
from ifcopenshell.api.geometry.data import Data as GeometryData
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -184,21 +184,14 @@ class UnassignClass(bpy.types.Operator):
|
||||
if not obj.BIMObjectProperties.ifc_definition_id:
|
||||
continue
|
||||
product = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
self.remove_representations(obj, product)
|
||||
IfcStore.unlink_element(product, obj)
|
||||
remove_product.Usecase(self.file, {"product": product}).execute()
|
||||
# TODO: remove object placement
|
||||
if "/" in obj.name and obj.name[0:3] == "Ifc":
|
||||
obj.name = "/".join(obj.name.split("/")[1:])
|
||||
if obj.data and obj.data.name == "Void":
|
||||
bpy.data.objects.remove(obj)
|
||||
return {"FINISHED"}
|
||||
|
||||
def remove_representations(self, obj, product):
|
||||
GeometryData.load(product.id())
|
||||
for representation_id in GeometryData.products[product.id()]:
|
||||
bpy.ops.bim.remove_representation(obj=obj.name, representation_id=representation_id)
|
||||
|
||||
|
||||
class UnlinkObject(bpy.types.Operator):
|
||||
bl_idname = "bim.unlink_object"
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
class Usecase:
|
||||
def __init__(self, file, settings=None):
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"product": None
|
||||
}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
|
||||
def execute(self):
|
||||
self.file.remove(self.settings["product"])
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.root.data import Data
|
||||
from ifcopenshell.api.root.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class BIM_PT_class(Panel):
|
||||
if props.ifc_definition_id:
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
try:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
except:
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text="IFC Element Not Found")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.sequence.data import Data
|
||||
from ifcopenshell.api.sequence.data import Data
|
||||
|
||||
|
||||
class LoadTasks(bpy.types.Operator):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from bpy.types import Panel, UIList
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.sequence.data import Data
|
||||
from ifcopenshell.api.sequence.data import Data
|
||||
|
||||
|
||||
class BIM_PT_tasks(Panel):
|
||||
@@ -17,7 +17,7 @@ class BIM_PT_tasks(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
self.props = context.scene.BIMTaskProperties
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import bpy
|
||||
import blenderbim.bim.module.spatial.assign_container as assign_container
|
||||
import blenderbim.bim.module.spatial.remove_container as remove_container
|
||||
import ifcopenshell.api.spatial.assign_container as assign_container
|
||||
import ifcopenshell.api.spatial.remove_container as remove_container
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.spatial.data import Data
|
||||
from ifcopenshell.api.spatial.data import Data
|
||||
from blenderbim.bim.module.spatial.prop import getSpatialContainers
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class AssignContainer(bpy.types.Operator):
|
||||
},
|
||||
).execute()
|
||||
bpy.ops.bim.edit_object_placement(obj=related_element.name)
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
bpy.ops.bim.disable_editing_container(obj=related_element.name)
|
||||
|
||||
aggregate_collection = bpy.data.collections.get(related_element.name)
|
||||
@@ -101,7 +101,7 @@ class RemoveContainer(bpy.types.Operator):
|
||||
oprops = obj.BIMObjectProperties
|
||||
self.file = IfcStore.get_file()
|
||||
remove_container.Usecase(self.file, {"product": self.file.by_id(oprops.ifc_definition_id)}).execute()
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
|
||||
aggregate_collection = bpy.data.collections.get(obj.name)
|
||||
if aggregate_collection:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from blenderbim.bim.prop import StrProperty, Attribute
|
||||
from blenderbim.bim.module.spatial.data import Data
|
||||
from ifcopenshell.api.spatial.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from bpy.types import PropertyGroup
|
||||
from bpy.props import (
|
||||
@@ -16,7 +16,7 @@ from bpy.props import (
|
||||
|
||||
|
||||
def getSpatialContainers(self, context, parent_id=None):
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
self.file = IfcStore.get_file()
|
||||
props = context.scene.BIMSpatialProperties
|
||||
while len(props.spatial_elements) > 0:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from bpy.types import Panel, UIList
|
||||
from blenderbim.bim.module.spatial.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from ifcopenshell.api.spatial.data import Data
|
||||
|
||||
|
||||
class BIM_PT_spatial(Panel):
|
||||
@@ -17,7 +18,7 @@ class BIM_PT_spatial(Panel):
|
||||
if not oprops.ifc_definition_id:
|
||||
return False
|
||||
if oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
if not Data.products[oprops.ifc_definition_id]:
|
||||
return False
|
||||
return True
|
||||
@@ -29,7 +30,7 @@ class BIM_PT_spatial(Panel):
|
||||
if not oprops.ifc_definition_id:
|
||||
return
|
||||
if oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
|
||||
if props.is_editing:
|
||||
row = self.layout.row(align=True)
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import bpy
|
||||
import json
|
||||
import blenderbim.bim.module.structural.add_structural_boundary_condition as add_structural_boundary_condition
|
||||
import blenderbim.bim.module.structural.edit_structural_boundary_condition as edit_structural_boundary_condition
|
||||
import blenderbim.bim.module.structural.remove_structural_boundary_condition as remove_structural_boundary_condition
|
||||
import blenderbim.bim.module.structural.add_structural_analysis_model as add_structural_analysis_model
|
||||
import blenderbim.bim.module.structural.edit_structural_analysis_model as edit_structural_analysis_model
|
||||
import blenderbim.bim.module.structural.remove_structural_analysis_model as remove_structural_analysis_model
|
||||
import blenderbim.bim.module.structural.assign_structural_analysis_model as assign_structural_analysis_model
|
||||
import blenderbim.bim.module.structural.unassign_structural_analysis_model as unassign_structural_analysis_model
|
||||
import ifcopenshell.api.structural.add_structural_boundary_condition as add_structural_boundary_condition
|
||||
import ifcopenshell.api.structural.edit_structural_boundary_condition as edit_structural_boundary_condition
|
||||
import ifcopenshell.api.structural.remove_structural_boundary_condition as remove_structural_boundary_condition
|
||||
import ifcopenshell.api.structural.add_structural_analysis_model as add_structural_analysis_model
|
||||
import ifcopenshell.api.structural.edit_structural_analysis_model as edit_structural_analysis_model
|
||||
import ifcopenshell.api.structural.remove_structural_analysis_model as remove_structural_analysis_model
|
||||
import ifcopenshell.api.structural.assign_structural_analysis_model as assign_structural_analysis_model
|
||||
import ifcopenshell.api.structural.unassign_structural_analysis_model as unassign_structural_analysis_model
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.structural.data import Data
|
||||
from ifcopenshell.api.structural.data import Data
|
||||
|
||||
|
||||
class AddStructuralBoundaryCondition(bpy.types.Operator):
|
||||
@@ -21,7 +21,7 @@ class AddStructuralBoundaryCondition(bpy.types.Operator):
|
||||
file = IfcStore.get_file()
|
||||
connection = file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
add_structural_boundary_condition.Usecase(file, {"connection": connection}).execute()
|
||||
Data.load(connection.id())
|
||||
Data.load(IfcStore.get_file(), connection.id())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class RemoveStructuralBoundaryCondition(bpy.types.Operator):
|
||||
file = IfcStore.get_file()
|
||||
connection = file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
remove_structural_boundary_condition.Usecase(file, {"connection": connection}).execute()
|
||||
Data.load(connection.id())
|
||||
Data.load(IfcStore.get_file(), connection.id())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class EditStructuralBoundaryCondition(bpy.types.Operator):
|
||||
attributes[attribute.name] = {"value": attribute.float_value, "type": attribute.enum_value}
|
||||
|
||||
edit_structural_boundary_condition.Usecase(file, {"condition": condition, "attributes": attributes}).execute()
|
||||
Data.load(connection.id())
|
||||
Data.load(IfcStore.get_file(), connection.id())
|
||||
bpy.ops.bim.disable_editing_structural_boundary_condition()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -147,7 +147,7 @@ class AddStructuralAnalysisModel(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
result = add_structural_analysis_model.Usecase(IfcStore.get_file()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_structural_analysis_models()
|
||||
bpy.ops.bim.enable_editing_structural_analysis_model(structural_analysis_model=result.id())
|
||||
return {"FINISHED"}
|
||||
@@ -172,7 +172,7 @@ class EditStructuralAnalysisModel(bpy.types.Operator):
|
||||
edit_structural_analysis_model.Usecase(
|
||||
self.file, {"structural_analysis_model": self.file.by_id(props.active_structural_analysis_model_id), "attributes": attributes}
|
||||
).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_structural_analysis_models()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -186,7 +186,7 @@ class RemoveStructuralAnalysisModel(bpy.types.Operator):
|
||||
props = context.scene.BIMStructuralProperties
|
||||
self.file = IfcStore.get_file()
|
||||
remove_structural_analysis_model.Usecase(self.file, {"structural_analysis_model": self.file.by_id(self.structural_analysis_model)}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
bpy.ops.bim.load_structural_analysis_models()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -245,7 +245,7 @@ class AssignStructuralAnalysisModel(bpy.types.Operator):
|
||||
"product": self.file.by_id(product.BIMObjectProperties.ifc_definition_id),
|
||||
"structural_analysis_model": self.file.by_id(self.structural_analysis_model)
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -262,5 +262,5 @@ class UnassignStructuralAnalysisModel(bpy.types.Operator):
|
||||
"product": self.file.by_id(product.BIMObjectProperties.ifc_definition_id),
|
||||
"structural_analysis_model": self.file.by_id(self.structural_analysis_model)
|
||||
}).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from bpy.types import Panel, UIList
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.structural.data import Data
|
||||
from ifcopenshell.api.structural.data import Data
|
||||
|
||||
|
||||
class BIM_PT_structural_boundary_conditions(Panel):
|
||||
@@ -26,7 +26,7 @@ class BIM_PT_structural_boundary_conditions(Panel):
|
||||
self.oprops = context.active_object.BIMObjectProperties
|
||||
self.props = context.active_object.BIMStructuralProperties
|
||||
if self.oprops.ifc_definition_id not in Data.boundary_conditions:
|
||||
Data.load(self.oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id)
|
||||
|
||||
self.data = Data.boundary_conditions[self.oprops.ifc_definition_id]
|
||||
|
||||
@@ -98,7 +98,7 @@ class BIM_PT_connected_structural_members(Panel):
|
||||
self.oprops = context.active_object.BIMObjectProperties
|
||||
self.props = context.active_object.BIMStructuralProperties
|
||||
if self.oprops.ifc_definition_id not in Data.connected_structural_members:
|
||||
Data.load(self.oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id)
|
||||
|
||||
self.data = Data.connected_structural_members[self.oprops.ifc_definition_id]
|
||||
|
||||
@@ -139,7 +139,7 @@ class BIM_PT_structural_analysis_models(Panel):
|
||||
|
||||
def draw(self, context):
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
self.props = context.scene.BIMStructuralProperties
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
import blenderbim.bim.module.style.add_style as add_style
|
||||
import blenderbim.bim.module.style.edit_style as edit_style
|
||||
import ifcopenshell.api.style.add_style as add_style
|
||||
import ifcopenshell.api.style.edit_style as edit_style
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import bpy
|
||||
import ifcopenshell.util.schema
|
||||
import ifcopenshell.util.type
|
||||
import blenderbim.bim.module.type.assign_type as assign_type
|
||||
import blenderbim.bim.module.type.unassign_type as unassign_type
|
||||
import blenderbim.bim.module.type.get_related_objects as get_related_objects
|
||||
import ifcopenshell.api.type.assign_type as assign_type
|
||||
import ifcopenshell.api.type.unassign_type as unassign_type
|
||||
import ifcopenshell.api.type.get_related_objects as get_related_objects
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.type.data import Data
|
||||
from ifcopenshell.api.type.data import Data
|
||||
from blenderbim.bim.module.type.prop import getIfcTypes, getAvailableTypes, updateTypeInstanceIfcClass
|
||||
from mathutils import Vector
|
||||
|
||||
@@ -31,7 +31,7 @@ class AssignType(bpy.types.Operator):
|
||||
"relating_type": self.file.by_id(relating_type),
|
||||
},
|
||||
).execute()
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
if self.file.by_id(relating_type).RepresentationMaps:
|
||||
bpy.ops.bim.map_representations(product_id=oprops.ifc_definition_id, type_product_id=relating_type)
|
||||
|
||||
@@ -57,7 +57,7 @@ class UnassignType(bpy.types.Operator):
|
||||
"related_object": self.file.by_id(oprops.ifc_definition_id),
|
||||
},
|
||||
).execute()
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.type.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from ifcopenshell.api.type.data import Data
|
||||
|
||||
|
||||
class BIM_PT_type(Panel):
|
||||
@@ -15,7 +16,7 @@ class BIM_PT_type(Panel):
|
||||
if not props.ifc_definition_id:
|
||||
return False
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
if not Data.products[props.ifc_definition_id]:
|
||||
return False
|
||||
return True
|
||||
@@ -27,7 +28,7 @@ class BIM_PT_type(Panel):
|
||||
if not oprops.ifc_definition_id:
|
||||
return
|
||||
if oprops.ifc_definition_id not in Data.products:
|
||||
Data.load(oprops.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), oprops.ifc_definition_id)
|
||||
|
||||
if props.is_editing_type:
|
||||
row = self.layout.row(align=True)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import bpy
|
||||
import blenderbim.bim.module.unit.assign_unit as assign_unit
|
||||
import ifcopenshell.api.unit.assign_unit as assign_unit
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.unit.data import Data
|
||||
from ifcopenshell.api.unit.data import Data
|
||||
|
||||
|
||||
class AssignUnit(bpy.types.Operator):
|
||||
@@ -10,7 +10,7 @@ class AssignUnit(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
assign_unit.Usecase(IfcStore.get_file(), self.get_units()).execute()
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
return {"FINISHED"}
|
||||
|
||||
def get_units(self):
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import bpy
|
||||
import blenderbim.bim.module.void.add_opening as add_opening
|
||||
import blenderbim.bim.module.void.remove_opening as remove_opening
|
||||
import blenderbim.bim.module.void.add_filling as add_filling
|
||||
import blenderbim.bim.module.void.remove_filling as remove_filling
|
||||
import ifcopenshell.api.void.add_opening as add_opening
|
||||
import ifcopenshell.api.void.remove_opening as remove_opening
|
||||
import ifcopenshell.api.void.add_filling as add_filling
|
||||
import ifcopenshell.api.void.remove_filling as remove_filling
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.void.data import Data
|
||||
from blenderbim.bim.module.context.data import Data as ContextData
|
||||
from ifcopenshell.api.void.data import Data
|
||||
from ifcopenshell.api.context.data import Data as ContextData
|
||||
|
||||
|
||||
class AddOpening(bpy.types.Operator):
|
||||
@@ -21,7 +21,7 @@ class AddOpening(bpy.types.Operator):
|
||||
if not opening.BIMObjectProperties.ifc_definition_id:
|
||||
body_context_id = None
|
||||
if not ContextData.is_loaded:
|
||||
ContextData.load()
|
||||
ContextData.load(IfcStore.get_file())
|
||||
for context in ContextData.contexts.values():
|
||||
for subcontext_id, subcontext in context["HasSubContexts"].items():
|
||||
if subcontext["ContextType"] == "Model" and subcontext["ContextIdentifier"] == "Body":
|
||||
@@ -40,7 +40,7 @@ class AddOpening(bpy.types.Operator):
|
||||
"element": self.file.by_id(element_id),
|
||||
},
|
||||
).execute()
|
||||
Data.load(element_id)
|
||||
Data.load(IfcStore.get_file(), element_id)
|
||||
|
||||
has_modifier = False
|
||||
|
||||
@@ -76,7 +76,7 @@ class RemoveOpening(bpy.types.Operator):
|
||||
break
|
||||
|
||||
remove_opening.Usecase(self.file, {"opening": self.file.by_id(self.opening_id)}).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class AddFilling(bpy.types.Operator):
|
||||
"element": self.file.by_id(element_id),
|
||||
},
|
||||
).execute()
|
||||
Data.load(element_id)
|
||||
Data.load(IfcStore.get_file(), element_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -113,5 +113,5 @@ class RemoveFilling(bpy.types.Operator):
|
||||
remove_filling.Usecase(
|
||||
self.file, {"element": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)}
|
||||
).execute()
|
||||
Data.load(obj.BIMObjectProperties.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.module.void.data import Data
|
||||
from ifcopenshell.api.void.data import Data
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class BIM_PT_voids(Panel):
|
||||
def draw(self, context):
|
||||
props = context.active_object.BIMObjectProperties
|
||||
if props.ifc_definition_id not in Data.products:
|
||||
Data.load(props.ifc_definition_id)
|
||||
Data.load(IfcStore.get_file(), props.ifc_definition_id)
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
if len(context.selected_objects) == 2:
|
||||
|
||||
@@ -163,10 +163,10 @@ def getMaterialPsetNames(self, context):
|
||||
|
||||
|
||||
def getContexts(self, context):
|
||||
from blenderbim.bim.module.context.data import Data
|
||||
from ifcopenshell.api.context.data import Data
|
||||
|
||||
if not Data.is_loaded:
|
||||
Data.load()
|
||||
Data.load(IfcStore.get_file())
|
||||
results = []
|
||||
for ifc_id, context in Data.contexts.items():
|
||||
results.append((str(ifc_id), context["ContextType"], ""))
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import ifcopenshell
|
||||
from blenderbim.bim.module.owner.api import create_owner_history
|
||||
from blenderbim.bim.module.owner.api import update_owner_history
|
||||
from ifcopenshell.api.owner.api import create_owner_history
|
||||
from ifcopenshell.api.owner.api import update_owner_history
|
||||
|
||||
|
||||
class Usecase:
|
||||
+1
-5
@@ -1,6 +1,3 @@
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
class Data:
|
||||
products = {}
|
||||
|
||||
@@ -9,8 +6,7 @@ class Data:
|
||||
cls.products = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, product_id):
|
||||
file = IfcStore.get_file()
|
||||
def load(cls, file, product_id):
|
||||
if not file:
|
||||
return
|
||||
product = file.by_id(product_id)
|
||||
+3
-4
@@ -1,6 +1,5 @@
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.attribute
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
class Data:
|
||||
@@ -11,13 +10,13 @@ class Data:
|
||||
cls.products = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, product_id):
|
||||
file = IfcStore.get_file()
|
||||
def load(cls, file, product_id):
|
||||
if not file:
|
||||
return
|
||||
product = file.by_id(product_id)
|
||||
schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(file.schema)
|
||||
cls.products[product_id] = []
|
||||
declaration = IfcStore.get_schema().declaration_by_name(product.is_a())
|
||||
declaration = schema.declaration_by_name(product.is_a())
|
||||
for attribute in declaration.all_attributes():
|
||||
data_type = ifcopenshell.util.attribute.get_primitive_type(attribute)
|
||||
value = getattr(product, attribute.name())
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
from blenderbim.bim.module.owner.api import update_owner_history
|
||||
from ifcopenshell.api.owner.api import update_owner_history
|
||||
|
||||
|
||||
class Usecase():
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.date
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
class Data:
|
||||
@@ -23,8 +22,8 @@ class Data:
|
||||
cls.library_references = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, product_id=None):
|
||||
cls._file = IfcStore.get_file()
|
||||
def load(cls, file, product_id=None):
|
||||
cls._file = file
|
||||
if not cls._file:
|
||||
return
|
||||
if product_id:
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.date
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@@ -16,8 +15,8 @@ class Data:
|
||||
cls.objectives = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, product_id=None):
|
||||
cls._file = IfcStore.get_file()
|
||||
def load(cls, file, product_id=None):
|
||||
cls._file = file
|
||||
if not cls._file:
|
||||
return
|
||||
if product_id:
|
||||
+1
-5
@@ -1,6 +1,3 @@
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
class Data:
|
||||
is_loaded = False
|
||||
contexts = {}
|
||||
@@ -11,8 +8,7 @@ class Data:
|
||||
cls.contexts = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls):
|
||||
file = IfcStore.get_file()
|
||||
def load(cls, file):
|
||||
if not file:
|
||||
return
|
||||
cls.contexts = {}
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.date
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@@ -18,8 +17,8 @@ class Data:
|
||||
cls.information = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, product_id=None):
|
||||
cls._file = IfcStore.get_file()
|
||||
def load(cls, file, product_id=None):
|
||||
cls._file = file
|
||||
if not cls._file:
|
||||
return
|
||||
if product_id:
|
||||
+1
-5
@@ -1,6 +1,3 @@
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
class Data:
|
||||
products = {}
|
||||
representations = {}
|
||||
@@ -11,8 +8,7 @@ class Data:
|
||||
cls.representations = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, product_id):
|
||||
file = IfcStore.get_file()
|
||||
def load(cls, file, product_id):
|
||||
if not file:
|
||||
return
|
||||
cls.products[product_id] = []
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import blenderbim.bim.module.geometry.remove_representation as remove_representation
|
||||
import ifcopenshell.api.geometry.remove_representation as remove_representation
|
||||
import ifcopenshell.util.element
|
||||
|
||||
|
||||
+1
-5
@@ -1,6 +1,3 @@
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
class Data:
|
||||
is_loaded = False
|
||||
map_conversion = {}
|
||||
@@ -13,8 +10,7 @@ class Data:
|
||||
cls.projected_crs = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls):
|
||||
file = IfcStore.get_file()
|
||||
def load(cls, file):
|
||||
if not file:
|
||||
return
|
||||
cls.map_conversion = {}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user