Author Topic: Check for Model Space UCS = World  (Read 3289 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
Check for Model Space UCS = World
« on: April 22, 2008, 03:01:54 PM »
In LISP, how does one check model space to see if the UCS is set to World? I have a simple cut-n-paste routine I have been meaning to add this too.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Check for Model Space UCS = World
« Reply #1 on: April 22, 2008, 03:42:23 PM »
This is what I use:

Code: [Select]
(if (equal (getvar 'ucsxdir) '(1.0 0.0 0.0) 0.0000001)
  (princ "\nUCS is world...")
  (princ "\nUCS not world...")
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Check for Model Space UCS = World
« Reply #2 on: April 22, 2008, 03:45:47 PM »
This is what I use:

Code: [Select]
(if (equal (getvar 'ucsxdir) '(1.0 0.0 0.0) 0.0000001)
  (princ "\nUCS is world...")
  (princ "\nUCS not world...")
)

If the ucs is rotated around the 'x' axis then this code will be lieing, as the ucs is not world.  I would think you would have to check at least two axis, but I wasn't sure that is why I didn't post an answer.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

DanB

  • Bull Frog
  • Posts: 367
Re: Check for Model Space UCS = World
« Reply #3 on: April 22, 2008, 04:07:47 PM »
Thanks, I think for the simple checking I need this may work. If anyone else has a different method please feel free to share as well.

CADaver

  • Guest
Re: Check for Model Space UCS = World
« Reply #4 on: April 22, 2008, 04:29:57 PM »
What about WORLDUCS ?

Code: [Select]
(if
   (equal (getvar 'worlducs) 1)
   (princ "\nUCS is world...")
   (princ "\nUCS not world...")
)

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2149
  • class keyThumper<T>:ILazy<T>
Re: Check for Model Space UCS = World
« Reply #5 on: April 22, 2008, 06:08:25 PM »
What about WORLDUCS ?

< .. >

yep, that's what I use ..
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Check for Model Space UCS = World
« Reply #6 on: April 23, 2008, 10:19:28 AM »
How long has worlducs been around?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

DanB

  • Bull Frog
  • Posts: 367
Re: Check for Model Space UCS = World
« Reply #7 on: April 23, 2008, 01:05:41 PM »
This looks even better, thanks.

Bob Wahr

  • Guest
Re: Check for Model Space UCS = World
« Reply #8 on: April 23, 2008, 01:28:07 PM »
How long has worlducs been around?
Looks like R12 at least.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Check for Model Space UCS = World
« Reply #9 on: April 23, 2008, 02:45:40 PM »
Thanks Bob :) I never seem to stop learning things about AutoCAD  :ugly:

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC