Should I Always Translate Coords?
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Should I Always Translate Coords?

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Oberer
Guest





Posted: Fri Mar 04, 2005 8:27 pm    Post subject: Should I Always Translate Coords? Reply with quote

I tend to use my ucs quite often and notice that many LDD routines and some that i've written need the coords to be in the world ucs.

So how do you safely program for drafters like me? That is, do you check the ucs, or translate the coords?

Would it be safe for me to always include a line similar to:
PickPoint = ThisDrawing.Utility.TranslateCoordinates(PickPoint, acWorld, acUCS, False)

Back to top
James Belshan
Guest





Posted: Fri Mar 04, 2005 10:29 pm    Post subject: Re: Should I Always Translate Coords? Reply with quote

Points returned by GetPoint, GetEntity, Object Properties, etc are always
in WCS, regardless of what the UCS is set to. The following simple example
will show different values if you move the UCS around. The user is entering
(0,0,0) in the current UCS, and the varPt() holds the equivalent WCS coords.

Code:

Sub test()
   Dim varPt As Variant
   varPt = ThisDrawing.Utility.GetPoint(, "Type 0,0,0 -->")
   MsgBox varPt(0) & ", " & varPt(1) & ", " & varPt(2)
End Sub


One annoying thing that I find is that the current UCS does affect entities
that you add. For example, a circle created by the AddCircle method will be
parallel to the UCS X-Y plane. But the coordinates that you give for its
center are in WCS. This is just an ACAD VBA quirk that you have to learn to
work around.

I didn't really answer your specific question, but I would say that you have
to just know what coordinates are going to be input to your routine, your
textboxes, etc, and do a translation if necessary.

James


"Oberer" <nospam@address.withheld> wrote in message
news:1618085.1109950071587.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
I tend to use my ucs quite often and notice that many LDD routines and
some that i've written need the coords to be in the world ucs.

So how do you safely program for drafters like me? That is, do you check
the ucs, or translate the coords?

Would it be safe for me to always include a line similar to:
PickPoint = ThisDrawing.Utility.TranslateCoordinates(PickPoint, acWorld,
acUCS, False)
Back to top
Oberer
Guest





Posted: Fri Apr 08, 2005 11:56 pm    Post subject: Re: Should I Always Translate Coords? Reply with quote

I'm going to bump this again to further the discussion. What i'm really asking is why don't we all check the ucs?
There are MANY LDD routines that refuse to check.
Even something basic like autocad's "find" (at least in 2k2) is thrown off by not being in the world ucs.

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB