mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
rename connection to boundary condition + minor edits
This commit is contained in:
@@ -19,8 +19,8 @@ classes = (
|
||||
prop.StructuralAnalysisModel,
|
||||
prop.BIMStructuralProperties,
|
||||
prop.BIMObjectStructuralProperties,
|
||||
ui.BIM_PT_structural,
|
||||
ui.BIM_PT_structural_connections,
|
||||
ui.BIM_PT_structural_analysis_models,
|
||||
ui.BIM_PT_structural_boundary_conditions,
|
||||
ui.BIM_UL_structural_analysis_models,
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ from blenderbim.bim.module.owner.api import update_owner_history
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, settings=None):
|
||||
def __init__(self, file, settings={}):
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"product": None,
|
||||
|
||||
@@ -4,19 +4,20 @@ from blenderbim.bim.ifc import IfcStore
|
||||
class Data:
|
||||
is_loaded = False
|
||||
products = {}
|
||||
boundary_conditions = {}
|
||||
structural_analysis_models = {}
|
||||
|
||||
@classmethod
|
||||
def purge(cls):
|
||||
cls.is_loaded = False
|
||||
cls.products = {}
|
||||
cls.connections = {}
|
||||
cls.boundary_conditions = {}
|
||||
cls.structural_analysis_models = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, product_id=None):
|
||||
if product_id:
|
||||
cls.connections = {}
|
||||
cls.boundary_conditions = {}
|
||||
return cls.load_structural_connection(product_id)
|
||||
cls.products = {}
|
||||
cls.structural_analysis_models = {}
|
||||
@@ -57,4 +58,4 @@ class Data:
|
||||
data[key] = value.wrappedValue
|
||||
else:
|
||||
data = {}
|
||||
cls.connections[connection.id()] = data
|
||||
cls.boundary_conditions[connection.id()] = data
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class Usecase:
|
||||
def __init__(self, file, settings=None):
|
||||
def __init__(self, file, settings={}):
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"structural_analysis_model": None,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class Usecase:
|
||||
def __init__(self, file, settings=None):
|
||||
def __init__(self, file, settings={}):
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"condition": None,
|
||||
|
||||
@@ -46,15 +46,15 @@ class EnableEditingStructuralBoundaryCondition(bpy.types.Operator):
|
||||
obj = context.active_object
|
||||
oprops = obj.BIMObjectProperties
|
||||
props = obj.BIMStructuralProperties
|
||||
while len(props.connection_attributes) > 0:
|
||||
props.connection_attributes.remove(0)
|
||||
while len(props.boundary_condition_attributes) > 0:
|
||||
props.boundary_condition_attributes.remove(0)
|
||||
|
||||
data = Data.connections[oprops.ifc_definition_id]
|
||||
data = Data.boundary_conditions[oprops.ifc_definition_id]
|
||||
|
||||
for attribute in IfcStore.get_schema().declaration_by_name(data["type"]).all_attributes():
|
||||
value = data[attribute.name()]
|
||||
data_type = str(attribute.type_of_attribute)
|
||||
new = props.connection_attributes.add()
|
||||
new = props.boundary_condition_attributes.add()
|
||||
new.name = attribute.name()
|
||||
new.is_null = value is None
|
||||
new.is_optional = attribute.optional()
|
||||
@@ -73,7 +73,7 @@ class EnableEditingStructuralBoundaryCondition(bpy.types.Operator):
|
||||
new.string_value = "" if new.is_null else data[attribute.name()]
|
||||
new.data_type = "string"
|
||||
|
||||
props.is_editing_connection = True
|
||||
props.is_editing_boundary_condition = True
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class EditStructuralBoundaryCondition(bpy.types.Operator):
|
||||
condition = connection.AppliedCondition
|
||||
|
||||
attributes = {}
|
||||
for attribute in props.connection_attributes:
|
||||
for attribute in props.boundary_condition_attributes:
|
||||
if attribute.is_null:
|
||||
attributes[attribute.name] = {"value": None, "type": "null"}
|
||||
elif attribute.data_type == "string":
|
||||
@@ -112,7 +112,7 @@ class DisableEditingStructuralBoundaryCondition(bpy.types.Operator):
|
||||
bl_label = "Disable Editing Structural Boundary Condition"
|
||||
|
||||
def execute(self, context):
|
||||
context.active_object.BIMStructuralProperties.is_editing_connection = False
|
||||
context.active_object.BIMStructuralProperties.is_editing_boundary_condition = False
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
@@ -29,5 +29,5 @@ class BIMStructuralProperties(PropertyGroup):
|
||||
|
||||
|
||||
class BIMObjectStructuralProperties(PropertyGroup):
|
||||
connection_attributes: CollectionProperty(name="Connection Attributes", type=Attribute)
|
||||
is_editing_connection: BoolProperty(name="Is Editing Connection", default=False)
|
||||
boundary_condition_attributes: CollectionProperty(name="Boundary Condition Attributes", type=Attribute)
|
||||
is_editing_boundary_condition: BoolProperty(name="Is Editing Boundary Condition", default=False)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class Usecase:
|
||||
def __init__(self, file, settings=None):
|
||||
def __init__(self, file, settings={}):
|
||||
self.file = file
|
||||
self.settings = {"structural_analysis_model": None}
|
||||
for key, value in settings.items():
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class Usecase:
|
||||
def __init__(self, file, settings=None):
|
||||
def __init__(self, file, settings={}):
|
||||
self.file = file
|
||||
self.settings = {"connection": None}
|
||||
for key, value in settings.items():
|
||||
|
||||
@@ -3,9 +3,9 @@ from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.bim.module.structural.data import Data
|
||||
|
||||
|
||||
class BIM_PT_structural_connections(Panel):
|
||||
bl_label = "IFC Structural Connections"
|
||||
bl_idname = "BIM_PT_structural_connections"
|
||||
class BIM_PT_structural_boundary_conditions(Panel):
|
||||
bl_label = "IFC Structural Boundary Conditions"
|
||||
bl_idname = "BIM_PT_structural_boundary_conditions"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
@@ -25,25 +25,25 @@ class BIM_PT_structural_connections(Panel):
|
||||
def draw(self, context):
|
||||
self.oprops = context.active_object.BIMObjectProperties
|
||||
self.props = context.active_object.BIMStructuralProperties
|
||||
if self.oprops.ifc_definition_id not in Data.connections:
|
||||
if self.oprops.ifc_definition_id not in Data.boundary_conditions:
|
||||
Data.load(self.oprops.ifc_definition_id)
|
||||
|
||||
self.data = Data.connections[self.oprops.ifc_definition_id]
|
||||
self.data = Data.boundary_conditions[self.oprops.ifc_definition_id]
|
||||
|
||||
row = self.layout.row(align=True)
|
||||
if self.data and self.props.is_editing_connection:
|
||||
if self.data and self.props.is_editing_boundary_condition:
|
||||
row.label(text=self.data["type"], icon="CON_TRACKTO")
|
||||
row.operator("bim.edit_structural_boundary_condition", text="", icon="CHECKMARK")
|
||||
row.operator("bim.disable_editing_structural_boundary_condition", text="", icon="X")
|
||||
elif self.data and not self.props.is_editing_connection:
|
||||
elif self.data and not self.props.is_editing_boundary_condition:
|
||||
row.label(text=self.data["type"], icon="CON_TRACKTO")
|
||||
row.operator("bim.enable_editing_structural_boundary_condition", text="", icon="GREASEPENCIL")
|
||||
row.operator("bim.remove_structural_boundary_condition", text="", icon="X")
|
||||
else:
|
||||
row.label(text="No Connection Found", icon="CON_TRACKTO")
|
||||
row.label(text="No Boundary Condition Found", icon="CON_TRACKTO")
|
||||
row.operator("bim.add_structural_boundary_condition", text="", icon="ADD")
|
||||
|
||||
if self.props.is_editing_connection:
|
||||
if self.props.is_editing_boundary_condition:
|
||||
self.draw_editable_ui(context)
|
||||
else:
|
||||
self.draw_read_only_ui(context)
|
||||
@@ -75,9 +75,9 @@ class BIM_PT_structural_connections(Panel):
|
||||
row.label(text=str(value))
|
||||
|
||||
|
||||
class BIM_PT_structural(Panel):
|
||||
class BIM_PT_structural_analysis_models(Panel):
|
||||
bl_label = "IFC Structural Analysis Models"
|
||||
bl_idname = "BIM_PT_structural"
|
||||
bl_idname = "BIM_PT_structural_analysis_models"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
|
||||
Reference in New Issue
Block a user