gazzalp Posted January 7, 2009 Posted January 7, 2009 We are looking at doing some programming in VBA, but one problem we are coming across is when we are trying to do certain commands, and points are involved, the program is taking the points from world coordinates. We usually have to rotate a floor plan etc so it looks square to us. So as an example, we have a rectangular floor plan, which is then rotated 30 degrees. We would usually then do a ucs, allign so the rectangle is now square to us (not on a 30 degree angle) and draw like this. so if we want to add 4 vertical lines to our plan we do the ucs, then add the lines. We want to make a macro (VBA) that will ask us for four points and add the lines for us. the problem is now that weve rotated our UCS and run the macro it seems to still look at the points as if we are in ucs world coordinates - and therefore puts our 4 lines off randomly in space. Is there a simple command/string to add into VBA so that it works when we have a different UCS other then world coordinates. Hope this makes sense, and thanks for your help. Quote
SEANT Posted January 7, 2009 Posted January 7, 2009 Look at ThisDrawing.Utility.TranslateCoordinates method. This will allow translation to and from the various coordinate systems available within AutoCAD. And, depending on the sequence of operations, the UCS method ”.GetUCSMatrix” and an entity’s “.TransformBy” method may also prove useful. Quote
gazzalp Posted January 8, 2009 Author Posted January 8, 2009 Thanks. not sure if it helped though (my boss is the one doing the prgramming, he has little idea about cad and i have even less idea about VBA..) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.