C# COM Block Inserting At The Wrong Coordinates

C# COM Block Inserting At The Wrong Coordinates

Anonymous
Not applicable
1,497 Views
2 Replies
Message 1 of 3

C# COM Block Inserting At The Wrong Coordinates

Anonymous
Not applicable

When inserting a block with COM and inputting coordinates to insert that block, it places the block elsewhere in the drawing. Am I missing something about the coordinate system that it uses when placing blocks?

 

I was just trying to find the coordinates through the actual AutoCAD drawing first by hovering over a location where I would want to insert it and looking at the coordinates provided at the the bottom of the window.

0 Likes
Accepted solutions (1)
1,498 Views
2 Replies
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor
Accepted solution

Entities' geometries saved in drawing database with World coordinate, while the coordinates you saw at AutoCAD's status bar by hovering the cursor over entity in AutoCAD editor may be in UCS. If an UCS is used and you use the numbers as you see in UCS as the coordinate to insert block in code, then that is the reason of your issue: you need to translate the UCS coordinate into world coordinates and use the translated coordinates (world coordinates) to insert block. You can look at AcadUtilities.TranslateCoordinates() method.

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks for the insight into the coordinate systems!

 

Just wondering, is there a way to return to the AutoCAD window, have a user click on a coordinate, and use that as my insertion coordinates? Would I need to translate those coordinates?

0 Likes