[Improvement] Selection of sources for the View

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

[Improvement] Selection of sources for the View

Post by vocx »

In TechDraw you first create a Page, then to create a View from the Model View you either select a Group containing objects, or select the individual objects, and then click TechDraw_NewView.

However, selecting a group does not select objects which are inside the main object; for example, if the group contains an Arch_Wall, none of the Arch_Windows embedded in it are selected.

If you double click the TechDraw View object, it allows you to change the name of it but you cannot edit it this way.

To change the objects that are viewed you need to edit the Source field in the Property view panel.

The Source field has a button to the right that when clicked shows similar objects to the ones already selected, that is, other groups, or other sketches, etc. It's also possible to select every object in the document, and None (remove link). This is a cumbersome way of changing which objects to show in the TechDraw View.
FreeCad_TechDraw_double_click_01_view_sources.png
FreeCad_TechDraw_double_click_01_view_sources.png (264.1 KiB) Viewed 3018 times
A better way of handling which objects to include in the View is to show dialogs like the Arch_Module does. For example, if you have an Arch_SectionPlane, you can double click on it; it will open the Tasks tab and show a list of objects. Initially there is no object, so you change to the Model tab, and choose the groups or individual objects that you want, change back to the Tasks tab, and hit Add. The objects that were selected are now part of the Section view.
FreeCad_TechDraw_double_click_02_Arch_section.png
FreeCad_TechDraw_double_click_02_Arch_section.png (46.88 KiB) Viewed 3018 times
FreeCad_TechDraw_double_click_03_section_components.png
FreeCad_TechDraw_double_click_03_section_components.png (59.9 KiB) Viewed 3018 times
The same with the Arch_Wall component. You can double click it, and it will allow you to select an object as the Base component, and Additions, and Subtractions.
FreeCad_TechDraw_double_click_04_wall_components.png
FreeCad_TechDraw_double_click_04_wall_components.png (29.16 KiB) Viewed 3018 times
The way the Arch Section and Wall objects allow us to add components and remove them should be implemented in TechDraw for Views, Links, etc.

OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14979 (Git)
Build type: Release
Branch: master
Hash: 47536dcd3729d3db106af628d62f2bf449e68c49
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Last edited by vocx on Fri Oct 19, 2018 10:48 pm, edited 1 time in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Improvement] Selection of sources for the View

Post by wandererfan »

vocx wrote: Thu Oct 18, 2018 11:54 pm However, selecting a group does not select objects which are inside the main object; for example, if the group contains an Arch_Wall, none of the Arch_Windows embedded in it are selected.
Not a big Arch user, but from what I can see Arch_Wall has no Property (like the Group Property in App::PartContainer) that points to its Arch_Windows. You would need special case logic to scan all the objects that link to the Wall and pick out the Windows.
I believe this logic exists in Arch (getGroupContents()???) but it hasn't migrated to the general TD View logic.
vocx wrote: Thu Oct 18, 2018 11:54 pm If you double click the TechDraw View object, it allows you to change the name of it but you cannot edit it this way.
To change the objects that are viewed you need to edit the Source field in the Property view panel.
TechDraw (mostly) follows the traditional FC user interaction model of "with these objects, perform this action". There have been many discussions about this in the Forum and some developers have implemented the "perform this action on these objects" model.
vocx wrote: Thu Oct 18, 2018 11:54 pm The Source field has a button to the right that when clicked shows similar objects to the ones already selected, that is, other groups, or other sketches, etc. It's also possible to select every object in the document, and None (remove link). This is a cumbersome way of changing which objects to show in the TechDraw View.
Is changing the objects in a View a common use case? An edit mode for the basic View never seemed necessary up to now.

Again, thanks for the feedback.

wf
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Improvement] Selection of sources for the View

Post by vocx »

wandererfan wrote: Fri Oct 19, 2018 2:25 pm Not a big Arch user, but from what I can see Arch_Wall has no Property (like the Group Property in App::PartContainer) that points to its Arch_Windows. You would need special case logic to scan all the objects that link to the Wall and pick out the Windows.
I believe this logic exists in Arch (getGroupContents()???) but it hasn't migrated to the general TD View logic.
Yes, that seems odd. On the other hand, Arch_Windows do have a Host property which may be an Arch_Wall, Arch_Structure, or Arch_Roof. So, you'd have to go the opposite way, scan all Arch objects, then see which of those have a Host that is currently being included in the Section view.
wandererfan wrote: Fri Oct 19, 2018 2:25 pm TechDraw (mostly) follows the traditional FC user interaction model of "with these objects, perform this action". There have been many discussions about this in the Forum and some developers have implemented the "perform this action on these objects" model.
I personally think it's a bit clunky and counter-intuitive. Like you need to select the objects in the model tree, then click the action in the toolbar? Then there should be a button that says "Change objects in the view"; nevertheless, to do this simple action to me it's much easier to just double click the element. Just like with Arch components (Section planes, Walls, Windows, etc.) the basic edition is done by double-clicking, while some other options can be changed from the Property pane.
wandererfan wrote: Fri Oct 19, 2018 2:25 pm Is changing the objects in a View a common use case? An edit mode for the basic View never seemed necessary up to now.
I think it is, especially if you are in the prototyping stages of building a complex model, for example, a house; you need to be able to quickly add or remove elements in your views, to get a feeling of how the final product will look like. The View can keep the same properties of position, scale, caption, hidden lines, and direction, while you turn on and off (add and remove) different bodies. The alternative is to delete a View, and create it again with another set of objects; you'd need to set up all the properties every time you create a new view.

Maybe you subscribe to the premise of completely building the model in 3D first, and only at the end of the process add TechDraw Pages with the dimensions and different views. I think this is okay if you are building a single solid part, for example, to send for manufacturing. However, I'd like to have the ability of setting up a few views to which I can add different bodies and features as I go along with my modelling.

Added: it seems in Arch the class SectionPlaneTaskPanel seems to implement the graphical interface and the functions to add objects to the Arch_SectionPlane. Similar code could be used to add objects to the TechDraw View.

https://github.com/FreeCAD/FreeCAD/blob ... ne.py#L808
Last edited by vocx on Mon Oct 22, 2018 5:20 pm, edited 1 time in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [Improvement] Selection of sources for the View

Post by wandererfan »

vocx wrote: Thu Oct 18, 2018 11:54 pm The Source field has a button to the right that when clicked shows similar objects to the ones already selected, that is, other groups, or other sketches, etc. It's also possible to select every object in the document, and None (remove link). This is a cumbersome way of changing which objects to show in the TechDraw View.
If you want an editor for View parameters, you should create a Feature Request on Mantis. Things get forgotten on the Forum.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: [Improvement] Selection of sources for the View

Post by DeepSOIC »

vocx wrote: Thu Oct 18, 2018 11:54 pm However, selecting a group does not select objects which are inside the main object; for example, if the group contains an Arch_Wall, none of the Arch_Windows embedded in it are selected.
Can you please provide a file?

I am no Arch user, so I have no idea how it's supposed to work. But in general, if Wall doesn't have GroupExtension, then Window must be also in Group's Group property for things to work correctly. To check, you can try hiding the group - if Window gets hidden, it's in the group, otherwise it's in root (or maybe even in some other group).

TL;DR: if in the tree view it looks like an object must be in a group (or part, or body), doesn't necessarily mean it is. That's a big flaw of tree view, IMO.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Improvement] Selection of sources for the View

Post by vocx »

DeepSOIC wrote: Mon Oct 22, 2018 1:57 pm
vocx wrote: Thu Oct 18, 2018 11:54 pm However, selecting a group does not select objects which are inside the main object; for example, if the group contains an Arch_Wall, none of the Arch_Windows embedded in it are selected.
Can you please provide a file?

I am no Arch user, so I have no idea how it's supposed to work. But in general, if Wall doesn't have GroupExtension, then Window must be also in Group's Group property for things to work correctly. To check, you can try hiding the group - if Window gets hidden, it's in the group, otherwise it's in root (or maybe even in some other group).

TL;DR: if in the tree view it looks like an object must be in a group (or part, or body), doesn't necessarily mean it is. That's a big flaw of tree view, IMO.
You are correct. wandererfan already mentioned this.

The Arch Wall doesn't tell you which Arch Windows are inside of it. However, the opposite works. A Window does tell you which is its parent (Host), which may be a Wall, or it may be empty. If you hide the Wall, the Windows remain visible.

So, I guess it's Yorik's job to modify how an Arch Wall works, to have a Group property, to indicate the elements inside of it. Then TechDraw can automatically show the children elements inside that Group. Right now, the Wall is the Source of the View, but TechDraw has no knowledge of which elements are "inside" of it. And you are right, the Tree view kind of fools you into thinking they should be grouped.
Attachments
wall_and_space.fcstd
(80.1 KiB) Downloaded 63 times
FreeCad_TechDraw_Arch_Wall_objects.png
FreeCad_TechDraw_Arch_Wall_objects.png (107.88 KiB) Viewed 2917 times
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Improvement] Selection of sources for the View

Post by vocx »

wandererfan wrote: Mon Oct 22, 2018 1:48 pm If you want an editor for View parameters, you should create a Feature Request on Mantis. Things get forgotten on the Forum.
It's been reported as issue #0003647.

This is also related to issue #0003646, to edit the direction of the projection by double clicking the View.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [Improvement] Selection of sources for the View

Post by yorik »

vocx wrote: Mon Oct 22, 2018 5:54 pm So, I guess it's Yorik's job to modify how an Arch Wall works, to have a Group property, to indicate the elements inside of it. Then TechDraw can automatically show the children elements inside that Group.
It was like that at first, and we later on changed the system because it created a lot of circular dependencies all the time (the wall depends on the window which depends on the wall...). Now with this new system (it is the window who keeps track of the relationship, so the window can depend on the wall for other things, such as having its base sketch using a face of the wall as support), all the dependency problems are solved and IMHO things work much better.

Now it is true that TD (and a couple of other tools too) don't see the window anymore. The same problem happens for example when you switch off a group containing walls with windows: The windows stay on).

I'm not sure yet of the best way to address that, but I don't think going back to the old system is a good idea... One easy way to solve this that I'm using for now, is to also add the window to the same group as the wall is (or in a subgroup). And use that group as the TD view source. Then the window will be picked too. Maybe we should automatically create a group with windows, I'm not sure...
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Improvement] Selection of sources for the View

Post by vocx »

yorik wrote: Tue Oct 23, 2018 2:14 pm
vocx wrote: Mon Oct 22, 2018 5:54 pm So, I guess it's Yorik's job to modify how an Arch Wall works, to have a Group property, to indicate the elements inside of it. Then TechDraw can automatically show the children elements inside that Group.
...

I'm not sure yet of the best way to address that, but I don't think going back to the old system is a good idea...
Yes, I don't suggest going back to the old system if there are serious errors regarding circular dependencies. But something that works intuitively for the user.
One easy way to solve this that I'm using for now, is to also add the window to the same group as the wall is (or in a subgroup). And use that group as the TD view source. Then the window will be picked too. Maybe we should automatically create a group with windows, I'm not sure...
Yes, this is pretty much what I do, following your examples. I place Groups with Walls, and Groups with Windows, and include both groups in TechDraw. It's okay, but it's not intuitive for new users; it's a workaround.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply