Jump to content

Recommended Posts

Posted

Once upon a time I had a lsp routine called "untwist". Once a drawing was dview twisted (or having used the "twist" lsp) this "untwist" would rotate back to 0 and set the snapang to 0 as well!

I miss it.

Can anyone help me out. It's been so long now.

Posted
Once upon a time I had a lsp routine called "untwist". Once a drawing was dview twisted (or having used the "twist" lsp) this "untwist" would rotate back to 0 and set the snapang to 0 as well!

I miss it.

Can anyone help me out. It's been so long now.

All you need to do is use the plan world command and reset the snapang and angbase. You can also make sure to set the zoom the same by checking the variables viewsize and viewctr.

(if (not (= 1 (getvar 'cvport)))(command "._plan" "_w"))
 (setvar 'snapang 0)
 (setvar 'angbase 0)

Posted
All you need to do is use the plan world command and reset the snapang and angbase. You can also make sure to set the zoom the same by checking the variables viewsize and viewctr.
(if (not (= 1 (getvar 'cvport)))(command "._plan" "_w"))
 (setvar 'snapang 0)
 (setvar 'angbase 0)

 

Thanks for the reply. I am not fluent in LISP. Okay, I do not speak LISP at all! There's the confession.

Is your code actually the lisp that I can use? Or is that a few ideas to go by?

I was spoiled by having that lisp at one time. Wish I had put it in my pocket for later use.

Much appreciated.

Posted

Quickly written and untested:

(defun c:plan2 (/ *error* ctr ht)
 (defun *error* (msg)
   (LM:endundo (LM:acdoc))
   (if (not
         (member msg '("Function cancelled" "quit / exit abort"))
       )
     (princ (strcat "\nError: " msg))
   )
   (princ)
 )
 (if (> (getvar 'cvport) 1)
   (progn
     (LM:startundo (LM:acdoc))
     (command "._ucs" "_w")
     (setq ctr (getvar 'viewctr)
           ht  (getvar 'viewsize)
     )
     (command "._plan" "_W")
     (setvar 'snapang 0)
     (setvar 'angbase 0)
     (command "zoom" "c" ctr ht)
     (LM:endundo (LM:acdoc))
   )
 )
 (princ)
)
;;;Created by Lee Mac
(defun LM:startundo (doc)
 (LM:endundo doc)
 (vla-startundomark doc)
)
;;;Created by Lee Mac
(defun LM:endundo (doc)
 (while (= 8 (logand 8 (getvar 'undoctl)))
   (vla-endundomark doc)
 )
)
;;;Created by Lee Mac
(defun LM:acdoc nil
 (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object))))
 (LM:acdoc)
)

Posted

Well, you are the king! It works. I could never had done that.

Many, many thanks.

Posted

How about a simple macro?

^C^C_dview;all;;tw;0;^P(progn(setvar "snapang" 0)(princ)) 

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