Oberer
Guest
|
Posted:
Fri Mar 04, 2005 8:27 pm Post subject:
Should I Always Translate Coords? |
|
|
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)
|
|
James Belshan
Guest
|
Posted:
Fri Mar 04, 2005 10:29 pm Post subject:
Re: Should I Always Translate Coords? |
|
|
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) |
|
|