mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
The copy property tool now works on enumerated properties. Hooray for copying over statuses!
This commit is contained in:
@@ -455,7 +455,13 @@ class CopyPropertyToSelection(bpy.types.Operator, Operator):
|
||||
else:
|
||||
is_pset = context.active_object.PsetProperties.active_pset_type == "PSET"
|
||||
pset_name = context.active_object.PsetProperties.active_pset_name
|
||||
prop_value = context.active_object.PsetProperties.properties.get(self.name).metadata.get_value()
|
||||
prop = context.active_object.PsetProperties.properties.get(self.name)
|
||||
if prop.value_type == "IfcPropertySingleValue":
|
||||
prop_value = prop.metadata.get_value()
|
||||
elif prop.value_type == "IfcPropertyEnumeratedValue":
|
||||
value_name = prop.metadata.get_value_name()
|
||||
prop_value = [e[value_name] for e in prop.enumerated_value.enumerated_values if e.is_selected]
|
||||
|
||||
for obj in tool.Blender.get_selected_objects():
|
||||
core.copy_property_to_selection(
|
||||
tool.Ifc,
|
||||
|
||||
@@ -71,6 +71,9 @@ def draw_enumerated_property(prop, layout, copy_operator=None):
|
||||
grid = layout.column_flow(columns=3)
|
||||
for e in prop.enumerated_value.enumerated_values:
|
||||
grid.prop(e, "is_selected", text=str(e[value_name]))
|
||||
if copy_operator:
|
||||
op = layout.operator(f"{copy_operator}", text="", icon="COPYDOWN")
|
||||
op.name = prop.metadata.name
|
||||
|
||||
|
||||
def get_active_pset_obj_name(context, obj_type):
|
||||
|
||||
Reference in New Issue
Block a user