.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Insert entities at the correct coordinates and rotation.

1 REPLY 1
Reply
Message 1 of 2
PTipton
331 Views, 1 Reply

Insert entities at the correct coordinates and rotation.

Hello,

 

My application inserts 4 DBText lines and 2 PolyLines into a drawing from another drawing(or Source Database). I created a special layer ("warning") into which these entities are inserted. Then I combined these entities into a group so the user can move it out of the way while they are working.

 

When the title block data is refreshed, I want to redraw my 4 lines of text and 2 lines at the location last set by the user.

 

I have succesfully implemented redrawing the object at the X and Y coordinates last placed by the user by using ent.TransformBy(Matrix3d.Displacement(acVec3d) on each entitiy at the source and then doing a DBSource.WblockCloneOjbects to put them in the destination drawing at the correct position.

 

However, if the user rotates the group, I need to make the rotation also. This is where I'm having problems. What is the best way to grab the rotation value(s?) from the existing, user placed group, and then redraw onto the drawing at that rotated value? Is there an easier implementation that the way I am doing it?

 

thanks,

Patrick

 

 

 

 

1 REPLY 1
Message 2 of 2
SENL1362
in reply to: PTipton

You could calculate the angle of one of the lines in the source drawing and then compare and adjust the angle of the cloned set.

 

Another solution may be to rotate the original objects indirect using a UCS. Then add the same UCS in the dest drawing.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost