How to Copy Placement Data to another Part

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!
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: How to Copy Placement Data to another Part

Post by openBrain »

louisgag wrote: Tue Feb 18, 2020 1:36 pm Thanks wandererfan for pointing this out.
For those looking to copy the placement properties between objects from different documents, the script can be further elaborated as such:
Seriously ?
  • The topic ended 4 years ago !!!
  • You import 'FreeCAD' in your script but don't use it. This is useless
  • Your script doesn't work if there is nothing to pause it during selection change
  • If your concern is about multiple documents, you should probably look at the global placements rather than the local ones
louisgag
Posts: 75
Joined: Fri Jan 17, 2020 9:59 am

Re: How to Copy Placement Data to another Part

Post by louisgag »

openBrain wrote: Tue Feb 18, 2020 1:55 pm
louisgag wrote: Tue Feb 18, 2020 1:36 pm Thanks wandererfan for pointing this out.
For those looking to copy the placement properties between objects from different documents, the script can be further elaborated as such:
Seriously ?
  • The topic ended 4 years ago !!!
  • You import 'FreeCAD' in your script but don't use it. This is useless
  • Your script doesn't work if there is nothing to pause it during selection change
  • If your concern is about multiple documents, you should probably look at the global placements rather than the local ones
That's not a nice answer.. the modified snippet was useful to me and I shared my modifications for those who would stubble upon the same thread.. apparently you would prefer that I had kept it for myself
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: How to Copy Placement Data to another Part

Post by openBrain »

louisgag wrote: Tue Feb 18, 2020 2:59 pm That's not a nice answer.. the modified snippet was useful to me and I shared my modifications for those who would stubble upon the same thread.. apparently you would prefer that I had kept it for myself
I won't discuss about necro-bumping a thread, YMMV. ;)
But at least I'd like that you posted a macro that works ! Don't tell me it works for you as you posted it. It can't. ;)
louisgag
Posts: 75
Joined: Fri Jan 17, 2020 9:59 am

Re: How to Copy Placement Data to another Part

Post by louisgag »

I'll risk getting told its wrong again, but you're right... that would not work as a macro.
It does from the Python console, "by hand", which is how I used it... because I just don't know of any "copy Placement" Gui operator.
Yes, I could have made that clearer!
Your comments about useless import and global placement are correct, but give me chance, I don't know FreeCAD so well ;)
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: How to Copy Placement Data to another Part

Post by openBrain »

louisgag wrote: Tue Feb 18, 2020 3:57 pm Yes, I could have made that clearer!
You can still edit your post to do it. ;)
Your comments about useless import and global placement are correct, but give me chance, I don't know FreeCAD so well ;)
You'll get your chance. I'm confident on this. :)
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: How to Copy Placement Data to another Part

Post by TheMarkster »

louisgag wrote: Tue Feb 18, 2020 3:57 pm I'll risk getting told its wrong again, but you're right... that would not work as a macro.
It does from the Python console, "by hand", which is how I used it... because I just don't know of any "copy Placement" Gui operator.
Yes, I could have made that clearer!
Your comments about useless import and global placement are correct, but give me chance, I don't know FreeCAD so well ;)
Have a look at the DynamicData workbench (installable via the addon manager). It has some capability to copy placement properties between objects and to link them via the expression engine, if desired. You can create properties of the placement type that can be used to store various placements, too.
louisgag
Posts: 75
Joined: Fri Jan 17, 2020 9:59 am

Re: How to Copy Placement Data to another Part

Post by louisgag »

Thanks TheMarkster for the tip on the DynamicData workbench, tried it and does what I was looking for.
openBrain: I edited the post as you suggested :)
Post Reply