Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UCS Rotation from WCS?

3 REPLIES 3
Reply
Message 1 of 4
mdhutchinson
954 Views, 3 Replies

UCS Rotation from WCS?

How can I find the angle rotation between a UCS and WCS?

3 REPLIES 3
Message 2 of 4
dbroad
in reply to: mdhutchinson

How generalized do you want the answer?  It can get relatively complex.

 

For a simple case where the current ucs has only  a rotation is about the z-axis, this would work:

 

(angle (trans '(0 0 0) 1 0) (trans '(1 0 0) 1 0))

 

It would return the rotation of the z axis in radians.

 

If multiple rotations around various axes are present, it gets complicated.

Architect, Registered NC, VA, SC, & GA.
Message 3 of 4
mdhutchinson
in reply to: mdhutchinson

I have an issue with 3rd party objects that refuse to stretch... I think it might have something to do with what may actually be a bug in AutoCAD (not the 3rd party software)

 

Think through the following - then try it.

 

  1. Set LUNITES = 1    (Scientific Notation)
  2. Set LUPREC = 8  (Max precision)
  3. Set up a UCS that is 7.5 degrees rotated from the WCS.
  4. Set Orthomode = 1  (O
  5. Draw a few separate lines from an arbitrary point at a direct distance of 300 units.
  6. Do a LIST command on the lines.
  7. The Delta Y values should all be 0.00000000E+00 ... right?

(See the attached)

 

 

Message 4 of 4
dbroad
in reply to: mdhutchinson

No, they won't necessarily be the same.  There is a roundoff involved.  Limit of accuracy is 14 significant figures. When testing for equality, you need to add a fuzz factor. -1.4...E-14 is for all intents and purposes equal to 0.

Architect, Registered NC, VA, SC, & GA.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost