Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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..)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...