What is the intension of Tip property in App::Document?
I don't really see why it may be needed in a multi-body document...
App::Document:Tip what is the intension of the property?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: App::Document:Tip what is the intension of the property?
I think it has the same purpose than the tip for the part: to have allow a reference to it which is independent of changes in the model, to always get the latest document object. Multi document assemblies may still be far away, but keeping the tip working even now seems reasonable.
Re: App::Document:Tip what is the intension of the property?
Parts don't have tips, only bodies, just a slip of the tongue?ickby wrote:I think it has the same purpose than the tip for the part: to have allow a reference to it which is independent of changes in the model, to always get the latest document object.
Hmm... as variant... But in case of multi document assembly wouldn't it be better to import/link all top-level assembly & parts objects to/from the higher level document, rather than getting only one part? Or even better, make user to decide?ickby wrote: Multi document assemblies may still be far away, but keeping the tip working even now seems reasonable.
Re: App::Document:Tip what is the intension of the property?
well true. I can only suspect that it was intended to be like I described, but your arguments are valid. So I don't know, we would need to ask jriegel for his intentions. Maybe it is a relict of some older intended scheme, maybe it is needed for something...
Re: App::Document:Tip what is the intension of the property?
Thanks, so I won't be too gentle with code that sets it and checks in the Workbench.cpp
Re: App::Document:Tip what is the intension of the property?
Seems I finally got what's that property was used for:
It determined the active Part of the document before the getActiveObject() interface come into use. I suppose it may be safely removed in favor of the last one...
It determined the active Part of the document before the getActiveObject() interface come into use. I suppose it may be safely removed in favor of the last one...
Re: App::Document:Tip what is the intension of the property?
If you see a document as a DAG, it can have more then one root objects, which are in no way easy to determine. Tip was introduced for a multi-document environment. A pure PartDesign document will have the Tip pointing to a Part. A Assembly document to the root Assembly/View. A FEM document to the Analysis object.
At the moment all our objects are in one document. That will not sustain far into the future. We have to deal with large assemblies and complicated configurations. There fore splitting designs into handleable parts is important. And the Tip properties is the first link into an document from the outside. Kind of interface from other documents referencing onto it.
At the moment it can be used to determine the (standard) Part of an Part document. In case the user opens a part document into the assembly workbench I will create a simple product structure and replace the Tip with the Assembly and put the Part into the simple Product structure.
More tricky will be the way back. There I would plan to open the PartWorkbench when the user double click on the Part and set this Part as active. But the Tip of document is still the Assembly. But Part Design works on the double clicked Part...
At the moment all our objects are in one document. That will not sustain far into the future. We have to deal with large assemblies and complicated configurations. There fore splitting designs into handleable parts is important. And the Tip properties is the first link into an document from the outside. Kind of interface from other documents referencing onto it.
At the moment it can be used to determine the (standard) Part of an Part document. In case the user opens a part document into the assembly workbench I will create a simple product structure and replace the Tip with the Assembly and put the Part into the simple Product structure.
More tricky will be the way back. There I would plan to open the PartWorkbench when the user double click on the Part and set this Part as active. But the Tip of document is still the Assembly. But Part Design works on the double clicked Part...
Stop whining - start coding!
Re: App::Document:Tip what is the intension of the property?
Hmm... I still don't really see the benefits of the Tip in document here:jriegel wrote:If you see a document as a DAG, it can have more then one root objects, which are in no way easy to determine. Tip was introduced for a multi-document environment. A pure PartDesign document will have the Tip pointing to a Part. A Assembly document to the root Assembly/View. A FEM document to the Analysis object.
In your terms (focusing on interaction of the Assembly and PartDesign documents):
- If a PartDesign document contains only one Parts — no need in the Tip the only toplevel part will be Imported into the Assembly document.
- If a PartDesign document contain several Parts, doesn't it better to pass all of them into Assembly or let the user decide which of them to use on the side of the assembly document?
- If it's an Assembly document which contains one Product, again Tip is excess, when importing into the next level Assembly
- If Assembly document have several top levels import all and/or let the user decide...
Re: App::Document:Tip what is the intension of the property?
Sure, but you have to do always do some DAG processing (searching) which one is you tip. Or you just save a pointer to it.
Stop whining - start coding!