Move view or section to another page

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Oyibo
Posts: 3
Joined: Wed Oct 14, 2020 1:20 pm

Move view or section to another page

Post by Oyibo »

Hello FreeCAD Community,

if you create a page with the TechDraw workbench and add different views, sections or details, is it possible to shift these objecs to another page?
dummy.png
dummy.png (297.29 KiB) Viewed 3099 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Move view or section to another page

Post by uwestoehr »

This is not possible and a known limitation:
https://wiki.freecadweb.org/TechDraw_Wo ... imitations
(last point)

by the way, to tell us your FreeCAD version, just click in the About dialog on "in die Zwischenablage kopieren" and then paste to your post.
Oyibo
Posts: 3
Joined: Wed Oct 14, 2020 1:20 pm

Re: Move view or section to another page

Post by Oyibo »

Thank you @uwestoehr for the quick reply.
It is really a pity that it is sometimes difficult to adjust the layout of TechDraw "page" objects afterwards. This implies that before you start compiling, measuring and labeling drawings, you have to have exact ideas about how the result should look like or you do part of the work twice.
For now, that's the way it is.
I really appreciate your help. Thanks.

System information:
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.26683 (Git)
Build type: Release
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: German/Germany (de_DE)
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: Move view or section to another page

Post by chrisb »

Oyibo wrote: Thu Jan 06, 2022 1:40 pm if you create a page with the TechDraw workbench and add different views, sections or details, is it possible to shift these objecs to another page?
It can be done but is a bit tricky. Please report back if it works for you:
- select Page2
- select the value of Views
- click the button occurring at the right
- select the view(s) you want to move in the upper window and confirm
- do the same with Page1, now removing the items
- recompute (not sure if this is needed)

- (now it becomes cumbersome) save the file and reopen it

The views are moved.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Oyibo
Posts: 3
Joined: Wed Oct 14, 2020 1:20 pm

Re: Move view or section to another page

Post by Oyibo »

Hi @chrisb,

GREAT!!! The described method works (nearly perfect). Thank you very much.

You can add the desired view to "page_2" and it will appear there immediately.
Then you can remove the view from "page_1". But, as you said, the changes on page_1 appear only after the file is saved, closed and reopened.
I really appreciate the quick help on this topic. Thanks.
Screenshot 2022-01-06 204236.png
Screenshot 2022-01-06 204236.png (163.31 KiB) Viewed 2926 times
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Move view or section to another page

Post by wandererfan »

TechDraw_MoveView and TechDraw_CopyView

git commit 5a40cd0a

These are the first TechDraw commands written in Python, so please report any oddities you encounter.
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Re: Move view or section to another page

Post by Roy_043 »

I notice two issues:

Path to the ui files is incorrect in TaskMoveView.py and TaskCopyView.py.
I had to change "Mod/TechDraw/Gui/.." to "Mod/TechDraw/TechDrawTools/.."

After using TechDraw_CopyView there is a warning:
View belongs to multiple Pages

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.27271 (Git)
Build type: Release
Branch: master
Hash: f045a0b6f12ec82c0ddb44570c81dfcc3940af0d
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: Dutch/Netherlands (nl_NL)
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Move view or section to another page

Post by wandererfan »

Roy_043 wrote: Mon Jan 31, 2022 5:11 pm Path to the ui files is incorrect in TaskMoveView.py and TaskCopyView.py.
I had to change "Mod/TechDraw/Gui/.." to "Mod/TechDraw/TechDrawTools/.."
In my build environment, the ui files are in "Mod/TechDraw/Gui" but in freecad-daily they are in "Mod/TechDraw/TechDrawTools". My CMake scripting skills are rudimentary at best. Might need to hunt up some consulting help.
Roy_043 wrote: After using TechDraw_CopyView there is a warning:
View belongs to multiple Pages
This is just a reminder. After a copy, there is still only 1 View, but 2 Pages "own" it. So any changes made to the View from either Page will show on both Pages.

Thanks for the feedback.
User avatar
Roy_043
Veteran
Posts: 8544
Joined: Thu Dec 27, 2018 12:28 pm

Re: Move view or section to another page

Post by Roy_043 »

wandererfan wrote: Mon Jan 31, 2022 8:28 pm This is just a reminder.
I actually read to Wiki documentation before using the tool, and still find the message confusing. My interpretation was: The code is doing something that is not allowed. I realize the color of the message would then be red instead of orange, but still.

I can also imagine that users create a copy with the intention of modifying it. Enabling that option, and adding a "Create linked views" toggle may be a good idea.
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Move view or section to another page

Post by wandererfan »

Roy_043 wrote: Mon Jan 31, 2022 8:59 pm I can also imagine that users create a copy with the intention of modifying it. Enabling that option, and adding a "Create linked views" toggle may be a good idea.
Making a new independent view is harder.

I'm hesitant to use "linked" because it might lead to confusion with @realthunder's links. Maybe what I called "Copy View" should be "Clone View", or maybe "Create shared view"?
Post Reply