mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 19:02:26 +00:00
Minor fixes after the refactor mess
This commit is contained in:
@@ -142,6 +142,7 @@ endif
|
|||||||
cd dist/working && unzip v0.6.0.zip
|
cd dist/working && unzip v0.6.0.zip
|
||||||
# IfcOpenBot sometimes lags behind, so we hotfix the Python utilities
|
# IfcOpenBot sometimes lags behind, so we hotfix the Python utilities
|
||||||
cp -r dist/working/IfcOpenShell-0.6.0/src/ifcopenshell-python/ifcopenshell/util/* dist/blenderbim/libs/site/packages/ifcopenshell/util/
|
cp -r dist/working/IfcOpenShell-0.6.0/src/ifcopenshell-python/ifcopenshell/util/* dist/blenderbim/libs/site/packages/ifcopenshell/util/
|
||||||
|
cp -r dist/working/IfcOpenShell-0.6.0/src/ifcopenshell-python/ifcopenshell/api dist/blenderbim/libs/site/packages/ifcopenshell/api
|
||||||
# Provides bcf functionality
|
# Provides bcf functionality
|
||||||
cp -r dist/working/IfcOpenShell-0.6.0/src/bcf/bcf dist/blenderbim/libs/site/packages/
|
cp -r dist/working/IfcOpenShell-0.6.0/src/bcf/bcf dist/blenderbim/libs/site/packages/
|
||||||
# Provides IFCClash functionality
|
# Provides IFCClash functionality
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import bpy
|
import bpy
|
||||||
import json
|
import json
|
||||||
|
import ifcopenshell
|
||||||
import ifcopenshell.api.structural.add_structural_boundary_condition as add_structural_boundary_condition
|
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.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.remove_structural_boundary_condition as remove_structural_boundary_condition
|
||||||
@@ -59,7 +60,7 @@ class EnableEditingStructuralBoundaryCondition(bpy.types.Operator):
|
|||||||
new.is_null = value is None
|
new.is_null = value is None
|
||||||
new.is_optional = attribute.optional()
|
new.is_optional = attribute.optional()
|
||||||
if data_type == "select":
|
if data_type == "select":
|
||||||
enum_items = [s.name() for s in ifcopenshell.get_select_items(attribute)]
|
enum_items = [s.name() for s in ifcopenshell.util.attribute.get_select_items(attribute)]
|
||||||
new.enum_items = json.dumps(enum_items)
|
new.enum_items = json.dumps(enum_items)
|
||||||
if isinstance(value, bool):
|
if isinstance(value, bool):
|
||||||
new.bool_value = False if new.is_null else data[attribute.name()]
|
new.bool_value = False if new.is_null else data[attribute.name()]
|
||||||
@@ -71,6 +72,7 @@ class EnableEditingStructuralBoundaryCondition(bpy.types.Operator):
|
|||||||
new.enum_value = [i for i in enum_items if i != "IfcBoolean"][0]
|
new.enum_value = [i for i in enum_items if i != "IfcBoolean"][0]
|
||||||
elif data_type == "string":
|
elif data_type == "string":
|
||||||
new.string_value = "" if new.is_null else data[attribute.name()]
|
new.string_value = "" if new.is_null else data[attribute.name()]
|
||||||
|
new.data_type = "string"
|
||||||
|
|
||||||
props.is_editing_boundary_condition = True
|
props.is_editing_boundary_condition = True
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class BIM_PT_structural_boundary_conditions(Panel):
|
|||||||
self.draw_read_only_ui(context)
|
self.draw_read_only_ui(context)
|
||||||
|
|
||||||
def draw_editable_ui(self, context):
|
def draw_editable_ui(self, context):
|
||||||
for attribute in self.props.connection_attributes:
|
for attribute in self.props.boundary_condition_attributes:
|
||||||
if attribute.data_type == "string":
|
if attribute.data_type == "string":
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.prop(attribute, "string_value", text=attribute["name"])
|
row.prop(attribute, "string_value", text=attribute["name"])
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ def get_primitive_type(attribute_or_data_type):
|
|||||||
data_type = str(attribute_or_data_type.type_of_attribute())
|
data_type = str(attribute_or_data_type.type_of_attribute())
|
||||||
else:
|
else:
|
||||||
data_type = str(attribute_or_data_type)
|
data_type = str(attribute_or_data_type)
|
||||||
if "<list" in data_type:
|
if "<select" in data_type:
|
||||||
|
return "select"
|
||||||
|
elif "<list" in data_type:
|
||||||
return ("list", get_primitive_type(data_type.replace("<list", "")))
|
return ("list", get_primitive_type(data_type.replace("<list", "")))
|
||||||
elif "<entity" in data_type:
|
elif "<entity" in data_type:
|
||||||
return "entity"
|
return "entity"
|
||||||
@@ -17,8 +19,6 @@ def get_primitive_type(attribute_or_data_type):
|
|||||||
return "boolean"
|
return "boolean"
|
||||||
elif "<enumeration" in data_type:
|
elif "<enumeration" in data_type:
|
||||||
return "enum"
|
return "enum"
|
||||||
elif "<select" in data_type:
|
|
||||||
return "select"
|
|
||||||
|
|
||||||
|
|
||||||
def get_enum_items(attribute):
|
def get_enum_items(attribute):
|
||||||
|
|||||||
Reference in New Issue
Block a user