Page 1 of 1

Copy objects

Posted: Wed Jul 01, 2020 3:55 am
by Anna Ginn
Hello
I have an iges file. I want to copy selected objects and the paste in different coordinates. How can I do it?
I do not see any samples about that.
Any suggestions?
Thank you

Re: Copy objects

Posted: Thu Jul 02, 2020 6:52 am
by Grassimo
Hi Anna
As per selection have a look at Selection topic in help and Pick sample. There are ways to get a list of IEntity_DG for the selected entities.

Once you have that, use IEntity_DG.Clone() to get a copy. Set its new location/orientation via IEntity_DG.GetLocation(), IFrame.SetOrigin() etc. These will modify the location immediately. Nothing else to call.

You might also need IView_DG to map screen <-> 3D coordinates.

Good luck

Re: Copy objects

Posted: Fri Jul 03, 2020 1:50 am
by Anna Ginn
Thank you! I'll try it!