Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by paddle »

Hey guys,

Ease of life feature today :

phpBB [video]


What do you think?

I'll make a PR soon.
Cheers
kisolre
Veteran
Posts: 4163
Joined: Wed Nov 21, 2018 1:13 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by kisolre »

Looks good.
Will it be able to paste outside sketcher edit mode? Like create a XY mapped sketch under current active Body/Part, add geometry directly to current selected sketch, ...?
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by paddle »

kisolre wrote: Wed Feb 02, 2022 10:05 am Looks good.
Will it be able to paste outside sketcher edit mode? Like create a XY mapped sketch under current active Body/Part, add geometry directly to current selected sketch, ...?
Currently it can't. It's working only in edit mode.

I don't understand well the model tree copy paste. I started to write about it and ended up making another topic :
https://forum.freecadweb.org/viewtopic.php?f=10&t=65899
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by bambuko »

I am not quite clear, please, on the behaviour of dimensional constraints between the feature on the sketch and LCS (either axis or point)
When copied these dimensions - do they reattach themselves to LCS when pasted, as they were in original copied sketch?
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by paddle »

bambuko wrote: Wed Feb 02, 2022 11:19 am I am not quite clear, please, on the behaviour of dimensional constraints between the feature on the sketch and LCS (either axis or point)
When copied these dimensions - do they reattach themselves to LCS when pasted, as they were in original copied sketch?
Yes they do. Sorry I didn't showed that in the video.
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by bambuko »

paddle wrote: Wed Feb 02, 2022 12:03 pm Yes they do. Sorry I didn't showed that in the video.
no problem :)
I thought I better ask here rather than on Youtube?

so I guess if you want to copy and re-use elsewhere (i.e. not tied to origin LCS), you better make sure to exclude this dims from your copy selection? :ugeek:
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
kisolre
Veteran
Posts: 4163
Joined: Wed Nov 21, 2018 1:13 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by kisolre »

What is the branch name for now?
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by paddle »

bambuko wrote: Wed Feb 02, 2022 12:04 pm no problem :)
I thought I better ask here rather than on Youtube?

so I guess if you want to copy and re-use elsewhere (i.e. not tied to origin LCS), you better make sure to exclude this dims from your copy selection? :ugeek:
Yes forum is probably the best place to discuss things. Though you can still drop the same comment on youtube, it helps thee channel grow (though does that really matter is a good question).

For the constraints to LCS it can be modified easily. I actually hesitate between both behaviours.
Indeed if it's to re-use in the same sketch it will obviously be to be used at another place, so the constraints to LCS doesn't make much sens. Unless you want to position it with them.

Hmm one way would be to offer the user the choice. But how is the question.
1 - Ctrl-V for paste without constraints to LCS, CTRL-ALT-V for paste with. But it my opinion complex shortcuts like that end up being known/used by very few people.
2 - Preference setting : It would be a pain to change between one and another.
3 - Make a SketchHandler instead of just a function called by ViewProviderSketch keypressed function. This way ctrl-V could call a more complex tool. The behaviour of the tool could be as follow :
- Paste geometries at mouse cursor.
- On mousemove make the geometries follow the cursor. (by group dragging)
- Left click 'drop' the geometries and close tool.
- right click cancels.
- Pressing SHIFT would alternate between following mouse cursor and keeping constraints to LCS (so original position)

I feel like option 3 is the best. But that requires group dragging to work, which is currently pending review/debugging.
Last edited by paddle on Wed Feb 02, 2022 12:30 pm, edited 1 time in total.
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by paddle »

kisolre wrote: Wed Feb 02, 2022 12:18 pm What is the branch name for now?
Cleaned up and now based on master:
branch :
https://github.com/PaddleStroke/FreeCAD ... steCtrlCXV
commit :
https://github.com/PaddleStroke/FreeCAD ... a1261ef014
Last edited by paddle on Wed Feb 02, 2022 4:31 pm, edited 2 times in total.
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Sketcher : Ctrl-C/X Ctrl-V to copy/paste/export/import

Post by bambuko »

paddle wrote: Wed Feb 02, 2022 12:27 pm 1 - Ctrl-V for paste without constraints to LCS, CTRL-ALT-V for paste with. But it my opinion complex shortcuts like that end up being known/used by very few people - not for me (bambuko)

2 - Preference setting : It would be a pain to change between one and another - not for me (bambuko)

3 - Make a SketchHandler instead of just a function called by ViewProviderSketch keypressed function. This way ctrl-V could call a more complex tool. The behaviour of the tool could be as follow :
- Paste geometries at mouse cursor - yes (bambuko)

- On mousemove make the geometries follow the cursor. (by group dragging) - yes (bambuko)
- Left click 'drop' the geometries and close tool - yes (bambuko)
- right click cancels - yes (bambuko)
- Pressing SHIFT would alternate between following mouse cursor and keeping constraints to LCS (so original position) - maybe (bambuko)
with my (obviously subjective :lol: ) comments
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
Post Reply