Jump to content
chulse

UCS WORLD without the UCS command call?

Recommended Posts

chulse

Ok, I found this little gem (a reactor to do various things on file close) from ASMI. What I'd like is to have it also automatically set the UCS to world on file close.

If I understand correctly that you cannot use "command" in a reactor (read here that I am completely new to reactors...and almost completely new to lisp...), is there another method for changing the UCS back to world that would work?

 

Thanks

Share this post


Link to post
Share on other sites
Lee Mac

I'm not sure of any other way to do it other than by creating a temporary UCS:

 

(defun UCSWorld (/ doc tmp)
 (setq doc (vla-get-ActiveDocument
             (vlax-get-acad-object)))
 
 (vla-put-ActiveUCS doc
   (vla-add (vla-get-usercoordinatesystems doc)
     (vlax-3D-point '(0. 0. 0.))
       (vlax-3D-point '(1. 0. 0.))
         (vlax-3D-point '(0. 1. 0.)) "TempWord_UCS")))

Share this post


Link to post
Share on other sites
chulse

Thanks Lee!

Share this post


Link to post
Share on other sites
Lee Mac
Thanks Lee!

 

You're welcome - its not perfect, and a bit of a workaround - I would welcome anyone to submit a better way.

Share this post


Link to post
Share on other sites
alanjt
You're welcome - its not perfect, and a bit of a workaround - I would welcome anyone to submit a better way.

Thanks how I would do it.

I used the same coding to do the same thing a while back. I just called it "World" and left it there.

Share this post


Link to post
Share on other sites
Lee Mac
Thanks how I would do it.

I used the same coding to do the same thing a while back. I just called it "World" and left it there.

 

I think I picked it up from somewhere in theSwamp - I wish there was a better way to do it.

Share this post


Link to post
Share on other sites
alanjt
I think I picked it up from somewhere in theSwamp

Same here.

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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