mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
BBIM Parametric psets - show warning when user edits them manually
as they are not intended to be edited manually but through the special ui example - https://i.imgur.com/nsuy0I0.png
This commit is contained in:
@@ -151,10 +151,17 @@ def draw_psetqto_ui(
|
||||
remove_pset_row.enabled = allow_removing
|
||||
if pset["is_expanded"]:
|
||||
if props.active_pset_id == pset_id:
|
||||
is_parametric_pset = props.active_pset_name in tool.Model.BBIM_PARAMETRIC_PSETS
|
||||
if is_parametric_pset:
|
||||
box_ = box.box()
|
||||
box_.alert = True
|
||||
box_.label(text="Warning! This pset should not be edited directly", icon="ERROR")
|
||||
box_.label(text="and should be edited from Parametric Geometry UI.")
|
||||
|
||||
for prop in props.properties:
|
||||
draw_psetqto_editable_ui(box, props, prop)
|
||||
|
||||
if not props.active_pset_has_template:
|
||||
if not props.active_pset_has_template and not is_parametric_pset:
|
||||
row = box.row(align=True)
|
||||
row.prop(props, "prop_name", text="")
|
||||
row.prop(props, "prop_value", text="")
|
||||
|
||||
@@ -846,6 +846,14 @@ class Model(bonsai.core.tool.Model):
|
||||
|
||||
AuthoringData.type_thumbnails[element.id()] = obj.preview.icon_id
|
||||
|
||||
BBIM_PARAMETRIC_PSETS = (
|
||||
"BBIM_Window",
|
||||
"BBIM_Door",
|
||||
"BBIM_Roof",
|
||||
"BBIM_Railing",
|
||||
"BBIM_Stair",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_modeling_bbim_pset_data(cls, object, pset_name):
|
||||
"""get modelling BBIM pset data (eg, BBIM_Roof) and loads it's `Data` as json to `data_dict`"""
|
||||
|
||||
Reference in New Issue
Block a user