Skip to content

Commit

Permalink
allow edit level height in View Manager directly
Browse files Browse the repository at this point in the history
  • Loading branch information
hoshengwei authored and yorikvanhavre committed Mar 11, 2024
1 parent fcfc189 commit 70dc24c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions BimViews.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def Activated(self):
dialog.buttonRename.clicked.connect(self.rename)
dialog.tree.itemClicked.connect(self.select)
dialog.tree.itemDoubleClicked.connect(show)
dialog.tree.itemChanged.connect(self.renameObject)
dialog.tree.itemChanged.connect(self.editObject)

# set the dock widget
vm.setObjectName("BIM Views Manager")
Expand Down Expand Up @@ -286,13 +286,15 @@ def rename(self):
item = vm.tree.selectedItems()[-1]
vm.tree.editItem(item, 0)

def renameObject(self, item, column):
"renames the actual object"
def editObject(self, item, column):
"renames or edit height of the actual object"

if column == 0:
obj = FreeCAD.ActiveDocument.getObject(item.toolTip(column))
if obj:
obj = FreeCAD.ActiveDocument.getObject(item.toolTip(0))
if obj:
if column == 0:
obj.Label = item.text(column)
if column == 1:
obj.Placement.Base.z = FreeCAD.Units.parseQuantity(item.text(column))

def toggle(self):
"toggle selected item on/off"
Expand Down

0 comments on commit 70dc24c

Please sign in to comment.