[Implemented] Ticket #3923 - change order in tree view
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
[Implemented] Ticket #3923 - change order in tree view
If new groups or objects are added to the document they will be at the end of the tree view. Is it somehow possible to change the order of the tree view elements (I am interested in the first level only) manually? Attached a screen. I would like to move the "Aufhaenger-extrahiert" to the top above "hilfskoerper-zwischenstufen" and "FB Stahltreppe alle teile" between "Fusion001" and "Analysis"
bernd
bernd
Last edited by Kunda1 on Fri Nov 12, 2021 12:24 pm, edited 2 times in total.
Reason: This feature has been implemented in v0.20dev
Reason: This feature has been implemented in v0.20dev
Re: change order in tree view
There a "hack" way :
- create a group
- put all the objects in it, in the desired order
- delete the group
- create a group
- put all the objects in it, in the desired order
- delete the group
Re: change order in tree view
I used this technique until I realised, that it does not survive save/reload .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: change order in tree view
I'd like to discuss this question too at some point... Obviously we'll need Werner's opinion.
The list of objects in a FreeCAD document is apparently just a simple array https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L2638 so in theory, it seems possible to remove an item from it and reinsert it at another place. AFAICS the tree is simply reflecting directly the array order
I tried this in the Path WB in the past, you can reorder objects inside a group (Path Compound): https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L2638 and it seems pretty stable...
Maybe we could try? Add a couple of methods to the FreeCAD document to move an object in the stack, and see what happens
The list of objects in a FreeCAD document is apparently just a simple array https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L2638 so in theory, it seems possible to remove an item from it and reinsert it at another place. AFAICS the tree is simply reflecting directly the array order
I tried this in the Path WB in the past, you can reorder objects inside a group (Path Compound): https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L2638 and it seems pretty stable...
Maybe we could try? Add a couple of methods to the FreeCAD document to move an object in the stack, and see what happens
Re: change order in tree view
since we have hundreds of messages each day especially in help, I sent him a message with a link to this topic.
cheers bernd
cheers bernd
Re: change order in tree view
IMO the easiest way would be to only change the tree view directly and do not touch the order of objects inside the document. To make the order of items in the tree view persistent the GuiDocument.xml can be extended to also store this order.
Re: change order in tree view
seams reosnable to me too, issue #3923
-
- Veteran
- Posts: 7791
- Joined: Tue Jan 07, 2014 11:10 am
- Contact:
Re: change order in tree view
I asked more or less the same question in August 2013:
https://forum.freecadweb.org/viewtopic. ... 220#p34220
With some strange answers.
Re: change order in tree view
What you asked there is something different because it has an impact on the result when you change the order of operations. Something similar exists in PD (since v0.17) where for a body you can change the position of a feature. It is not yet very robust but it's a start.freecad-heini-1 wrote: ↑Tue Apr 02, 2019 12:57 pm https://forum.freecadweb.org/viewtopic. ... 220#p34220
With some strange answers.
What has been asked here -- unless I have understood something wrong -- is a pure GUI thing without any impact on any operations.
Re: change order in tree view
I dont know how DragDrop is realized but now it forbids dragging from one container(Document, Part, Group) to itself. If just this was possible it would be easy to rearange objects in reverse order - move object to end of container tree.