Remove cloned/linked objects during Ctrl+C

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!
leoheck
Veteran
Posts: 1223
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Remove cloned/linked objects during Ctrl+C

Post by leoheck »

I use to copy and past Part Design objects to reuse them, or just to test stuff

This new "User Original Selection" button is very handy but I don't use it too much.
But for my process, a good thing to have would be to remove the Cloned to prevent duplicate unnecessary things.

Is it possible to ask for a button to unselect cloned, linked stuff?

When I unclick the "Clone 004, for instance," it undeletes a lot of stuff. Which is awesome. But having a button to do that would be much better since I just need to clone the current object and not all of its references since I am going to use it inside of the same file and then all the references are still working.
Attachments
Screenshot-20211130172305-582x662.png
Screenshot-20211130172305-582x662.png (122.85 KiB) Viewed 1476 times
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Remove cloned/linked objects during Ctrl+C

Post by TheMarkster »

Which objects are you trying to copy/duplicate in that image? Which did you select prior to pressing Ctrl + C? Which do you wish to retain checked after clicking this new button?
leoheck
Veteran
Posts: 1223
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: Remove cloned/linked objects during Ctrl+C

Post by leoheck »

Just one object was selected to be copied. The one that is at the top of the tree in the Hierarchy panel (Guts-Holder-Bottom_Bottom)

It was created by cloning another object. So it has this base feature that is another Body.

This base feature is shown in the Dependency panel as Clone004. It is not that hard to identify. Since it has a green arrow on its icon, which is mostly different than the other icons. But I always have to hunt it down.

Now, it used to appear on the Hierarchy panel too, if I am not mistaken, but this time it just appeared in the Dependency panel.

Unchecking the Clone004, removes other related objects, which is ok since they are not nested directly inside the object I want to copy.

Like the "Use Original Selections" button is a nice feature to preserve user intent.

Another interesting feature would be something that I am discussing here as "Nested item only" or "Avoid External/Linked features" or something with this intent.
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Remove cloned/linked objects during Ctrl+C

Post by chrisb »

This is a rather special use case. Others may want to exclude Part primitives or booleans or chamfers. So I would either leave it as is (my preferred solution until I'm convinced to something better) or add a possibility to exclude all kinds objects by type.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
mario52
Veteran
Posts: 4674
Joined: Wed May 16, 2012 2:13 pm

Re: Remove cloned/linked objects during Ctrl+C

Post by mario52 »

Hi

why not make a simple copy of the clone

Go to the menu Part → Create a copy → Image Create simple copy.

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
leoheck
Veteran
Posts: 1223
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: Remove cloned/linked objects during Ctrl+C

Post by leoheck »

mario52 wrote: Wed Dec 01, 2021 10:28 am why not make a simple copy of the clone
Hi Mairio. Because when I copy I want to change futures inside of the model.
leoheck
Veteran
Posts: 1223
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: Remove cloned/linked objects during Ctrl+C

Post by leoheck »

chrisb wrote: Wed Dec 01, 2021 7:25 am This is a rather special use case.
This is not a special case. IT IS NOT!

It is just the same single/simple/normal copy. Maybe the same as the "USE ORIGINAL SELECTION".

Actually, this is is the USE ORIGINAL SELECTION. Because the Original selection should copy the whole thing nested under the Object. Otherwise, it does not make sense anymore.

For instance, if you select a folder to be copied. It has to copy the contents of it too. The Blue Body thing is like a folder. The Assembly Yellow Body is a folder too. Or at least they should have been treated as a folder!

An analogy here - When I select a file, in the file system, and then I paste it somewhere. It should not paste THE WHOLE OPERATIONAL SYSTEM together, JUST because the FILE refers to something OUTSIDE of its SCOPE. This is somehow the default behavior on this Selection thing on Freecad. Maybe because the idea was to copy things from a file to another. Which is ok, then.

Now, the USE ORIGINAL SELECTION improves this behavior a bit by putting the user back in the control. But if the user has selected a Folder, Body, Assembly, or Any other Object that nests items under its hood. Then they have to be copied together. Otherwise, it loses its meaning.

Does it make sense? Or I am just leaving on another planet inside my head?
drmacro
Veteran
Posts: 8873
Joined: Sun Mar 02, 2014 4:35 pm

Re: Remove cloned/linked objects during Ctrl+C

Post by drmacro »

leoheck wrote: Wed Dec 01, 2021 2:57 pm ... The Blue Body thing is like a folder. The Assembly Yellow Body is a folder too. Or at least they should have been treated as a folder!

...
Hmm...yes they are both container objects. But, the Body object is a specialized container that is home to a single solitary solid that is the accumulation (in the specific order) of the contained operations.

The Std_Part (yellow icon) is a more generic container. For example it can contain Part workbench object, Part Design workbench Body objects, Groups, etc. But, The Body can't contain Groups or Std_Part objects.

So, no they aren't treated the same, nor should they be.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Remove cloned/linked objects during Ctrl+C

Post by chrisb »

leoheck wrote: Wed Dec 01, 2021 2:57 pm Actually, this is is the USE ORIGINAL SELECTION. Because the Original selection should copy the whole thing nested under the Object.
And so it does.
For instance, if you select a folder to be copied. It has to copy the contents of it too.
And so it does.
But if the user has selected a Folder, Body, Assembly, or Any other Object that nests items under its hood. Then they have to be copied together.
And so it does.
Does it make sense?
Yes and no. It works as you require here, but what has this to do with the clone?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Remove cloned/linked objects during Ctrl+C

Post by TheMarkster »

I suggest to expand the body and select the objects you wish to copy and not select the objects you do not wish to copy, then use original selections button. This is fairly painless to do in the tree using ctrl + click and shift + click. Then you don't have to fiddle so much with the dialog.
Post Reply