diff --git a/src/bonsai/bonsai/bim/module/pset/operator.py b/src/bonsai/bonsai/bim/module/pset/operator.py index d29045d4b0..896d0e856c 100644 --- a/src/bonsai/bonsai/bim/module/pset/operator.py +++ b/src/bonsai/bonsai/bim/module/pset/operator.py @@ -447,6 +447,33 @@ class AddProposedProp(bpy.types.Operator): prop_name: bpy.props.StringProperty() prop_value: bpy.props.StringProperty() + @classmethod + def description(cls, context, properties): + description = "Add proposed property to the custom property set.\n\n" + props = tool.Pset.get_pset_props(properties.obj, properties.obj_type) + if props.active_pset_type == "PSET": + description += ( + "Property type will be deduced from the provided value. Possible types:\n" + "- provide an integer or a float to create integer/real property\n" + "- 'true', 'false' to add a boolean property\n" + "- 'null' or '' (empty value) to add a null property\n" + "- any other value will be added as a string property" + ) + else: + from ifcopenshell.api.pset.edit_qto import FLOAT_TYPE_KEYWORDS + + description += ( + "Property type will be deduced from the provided value and property name. Possible types:\n" + "- Integer values - Count type\n" + "- Float values - will try to match one of the keywords below in prop name, " + "otherwise will default to Length type\n\n" + "Types and their keywords:\n" + ) + for prop_type, keywords in FLOAT_TYPE_KEYWORDS: + description += f"- {prop_type} - {', '.join(keywords)}\n" + description = description.rstrip() # Strip last newline. + return description + def execute(self, context): res = core.add_proposed_prop(tool.Pset, self.obj, self.obj_type, self.prop_name, self.prop_value) if res: