Jump to content

Recommended Posts

Posted

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

Posted

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")))

Posted
Thanks Lee!

 

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

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

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

Posted
I think I picked it up from somewhere in theSwamp

Same here.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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