mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Profiles UI - support renaming profiles by double-click
Example - https://imgur.com/a/05I5tSz
This commit is contained in:
@@ -43,8 +43,13 @@ def get_profile_classes(self, context):
|
||||
return ProfileData.data["profile_classes"]
|
||||
|
||||
|
||||
def update_profile_name(self: "Profile", context: bpy.types.Context) -> None:
|
||||
profile = tool.Ifc.get().by_id(self.ifc_definition_id)
|
||||
profile.ProfileName = self.name
|
||||
|
||||
|
||||
class Profile(PropertyGroup):
|
||||
name: StringProperty(name="Name")
|
||||
name: StringProperty(name="Name", update=update_profile_name)
|
||||
ifc_class: StringProperty(name="IFC Class")
|
||||
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class BIM_UL_profiles(UIList):
|
||||
props = context.scene.BIMProfileProperties
|
||||
if item:
|
||||
row = layout.row(align=True)
|
||||
row.label(text=item.name or "Unnamed")
|
||||
row.prop(item, "name", text="", emboss=False)
|
||||
row.label(text=item.ifc_class)
|
||||
|
||||
if props.active_profile_id == item.ifc_definition_id:
|
||||
|
||||
Reference in New Issue
Block a user