Copy objects

Technical discussions
Post Reply
Anna Ginn
Posts: 2
Joined: Wed Jul 24, 2019 5:51 am

Copy objects

Post 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

Grassimo
Posts: 4
Joined: Fri Jul 26, 2013 8:35 am

Re: Copy objects

Post 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

Anna Ginn
Posts: 2
Joined: Wed Jul 24, 2019 5:51 am

Re: Copy objects

Post by Anna Ginn »

Thank you! I'll try it!

Post Reply