{Feature request 4676] Std_DuplicateSelection exclude dependencies automatically?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
TedM
Posts: 141
Joined: Fri Apr 17, 2020 6:30 pm

{Feature request 4676] Std_DuplicateSelection exclude dependencies automatically?

Postby TedM » Wed Jun 02, 2021 6:03 am

Bug tracker issue #4676

Code: Select all

OS: Windows 10 Version 2004
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)
When using Std_DuplicateSelection, dependencies to the selected object(s) are automatically selected along with the user-selected object(s). This includes things referenced by expressions (spreadsheets, master sketches in other bodies, axis for such sketches, etc). I'm trying to duplicate a selected PartDesign body multiple times without duplicating the dependencies. Going through the selection check boxes to deselect the correct objects each time is turning into a royal pain.

Is there a way to easily deselect anything not specifically selected in Std_DuplicateSelection (or Std_Copy) or another method of copying without including dependencies?
Last edited by TedM on Sat Jun 05, 2021 6:14 am, edited 1 time in total.
chrisb
Posts: 35373
Joined: Tue Mar 17, 2015 9:14 am

Re: Std_DuplicateSelection exclude dependencies automatically?

Postby chrisb » Wed Jun 02, 2021 6:46 am

I almost never copy things with all their dependencies, so I would appreciate a pure copy command which copies just what I selected, and a copy-with-dependencies acting as it does now.
I have the strong feeling that Ctrl-C should copy without any additional questioning. That's how I know it from other applications.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TedM
Posts: 141
Joined: Fri Apr 17, 2020 6:30 pm

Re: Std_DuplicateSelection exclude dependencies automatically?

Postby TedM » Wed Jun 02, 2021 7:38 am

Assuming this functionality is not currently there, I will plan to add a feature request to the bug tracker.

My thought, to avoid changing the current operation which users might be use to, is to add a button to the dialog box to deselect dependencies.
User avatar
Roy_043
Posts: 3085
Joined: Thu Dec 27, 2018 12:28 pm

Re: Std_DuplicateSelection exclude dependencies automatically?

Postby Roy_043 » Wed Jun 02, 2021 7:46 am

You can try using Draft_Move with the copy option.
TedM
Posts: 141
Joined: Fri Apr 17, 2020 6:30 pm

Re: Std_DuplicateSelection exclude dependencies automatically?

Postby TedM » Wed Jun 02, 2021 6:22 pm

Roy_043 wrote: Wed Jun 02, 2021 7:46 am You can try using Draft_Move with the copy option.
Nope. The result was the same as DuplicateSelection with everything checked. I didn't even have the opportunity to deselect the undesired items.

By the way, I realized that this whole copy dependencies business is pretty bad. Where the dependencies are PD features, they end up being copied outside of a body! I guess this could be useful if you're planning to then move them into a body but doing this by default just seems wrong!

I'm starting to think that having the dependencies copied by default should be reported as a bug, not a feature request to turn it off! Thoughts?
User avatar
Roy_043
Posts: 3085
Joined: Thu Dec 27, 2018 12:28 pm

Re: Std_DuplicateSelection exclude dependencies automatically?

Postby Roy_043 » Wed Jun 02, 2021 6:50 pm

TedM wrote: Wed Jun 02, 2021 6:22 pmNope.
In a test with a sketch linked to a spreadsheet, The copied sketch is linked to the same spreadsheet. Can you provide a sample file?

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.24986 (Git)
Build type: Release
Branch: master
Hash: ff6845e2f31988cc714027980e0100bb5521843e
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
User avatar
Roy_043
Posts: 3085
Joined: Thu Dec 27, 2018 12:28 pm

Re: Std_DuplicateSelection exclude dependencies automatically?

Postby Roy_043 » Wed Jun 02, 2021 7:02 pm

TedM wrote: Wed Jun 02, 2021 6:22 pm I'm starting to think that having the dependencies copied by default should be reported as a bug, not a feature request to turn it off! Thoughts?
It really depends on your workflow. What may help is the introduction of 'Select all' and 'Deselect all except user selection' buttons. And the Std_DuplicateSelection command could use the last option as the default.
TedM
Posts: 141
Joined: Fri Apr 17, 2020 6:30 pm

Re: Std_DuplicateSelection exclude dependencies automatically?

Postby TedM » Wed Jun 02, 2021 8:16 pm

Roy_043 wrote: Wed Jun 02, 2021 6:50 pm
TedM wrote: Wed Jun 02, 2021 6:22 pmNope.
In a test with a sketch linked to a spreadsheet, The copied sketch is linked to the same spreadsheet. Can you provide a sample file?
Here's a sample showing the issue.
duplicationSelection 1.jpg
duplicationSelection 1.jpg (206.15 KiB) Viewed 355 times
Sketch001 in Body001 used Sketcher_CarbonCopy to duplicate Sketch in Body and so depends on it.

I then deactivate all bodies, select Body001 do Std_DuplicateSelection and click OK without deselecting anything. The result is that in addition to Body001 and all of its features being duplicated into Body002, Sketch002 and XY_Plane002 (copies of the dependencies) are placed outside of any bodies.
duplicationSelection 2.jpg
duplicationSelection 2.jpg (110.32 KiB) Viewed 355 times
Draft_Move with copy produces the same thing except that Sketch002 and XY_Plane002 are located before Body002 instead of after.
Attachments
duplicateSelection sample.FCStd
(12.03 KiB) Downloaded 5 times
chrisb
Posts: 35373
Joined: Tue Mar 17, 2015 9:14 am

Re: Std_DuplicateSelection exclude dependencies automatically?

Postby chrisb » Wed Jun 02, 2021 11:08 pm

If you have to copy several items, it would be good to have a copy command without opening any popup.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TedM
Posts: 141
Joined: Fri Apr 17, 2020 6:30 pm

Re: {Feature request 4676] Std_DuplicateSelection exclude dependencies automatically?

Postby TedM » Sat Jun 05, 2021 6:15 am

Bug tracker issue #4676 submitted.

Due to another problem, I was unable to upload the sample file to the bug tracker. Here is the file that should have been uploaded:
duplicateSelection sample.FCStd
(11.45 KiB) Downloaded 4 times