Jump to content
Aftertouch

Keep snap override while command active

Recommended Posts

Aftertouch

Hello everybody,

 

Is it possible to keep a snap override active during the whole command?

Now i have to override it again after each click.

Share this post


Link to post
Share on other sites
CyberAngel

I'll assume you don't want to keep that snap active all the time, otherwise you wouldn't be asking the question. My solution would be to write a LISP function that overrides the command you're using. For instance, if you're drawing a polyline and need the perpendicular snap, your code would do this:

 

defun PPLINE

PER snap ON

PLINE

PER snap OFF

 

So instead of calling the polyline command directly, you invoke the new PPLINE function.

 

If I've misread the situation, please provide more information.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Aftertouch

Thanks for the reply...

As i tought, its not possible. 😞

so i wrote a LISP for it. 🙂

 


(defun C:MULTISNAP ( / multisnap )
    (if (not hboldsnap)(setq hboldsnap (getvar "OSMODE")))
    (initget "END MID CEN NOD QUA INT INS PER TAN NEA GCEN EXT PAR RESET")
    (setq multisnap (getkword (strcat "\nMultiple snap override [END/MID/CEN/NOD/QUA/INT/INS/PER/TAN/NEA/GCEN/EXT/PAR/RESET]: ")))
    (if (not multisnap)(setq multisnap "END"))
    (cond
        ((= multisnap "END")(setq multisnap 1))
        ((= multisnap "MID")(setq multisnap 2))
        ((= multisnap "CEN")(setq multisnap 4))
        ((= multisnap "NOD")(setq multisnap 8))
        ((= multisnap "QUA")(setq multisnap 16))
        ((= multisnap "INT")(setq multisnap 32))
        ((= multisnap "INS")(setq multisnap 64))
        ((= multisnap "PER")(setq multisnap 128))
        ((= multisnap "TAN")(setq multisnap 256))
        ((= multisnap "NEA")(setq multisnap 512))
        ((= multisnap "GCEN")(setq multisnap 1024))
        ((= multisnap "EXT")(setq multisnap 4096))
        ((= multisnap "PAR")(setq multisnap 8192))
        ((= multisnap "RESET")(setq multisnap hboldsnap))
    )
    (setvar "OSMODE" multisnap)
(princ)
)

  • Like 1

Share this post


Link to post
Share on other sites
Incognito Cube

Alternatively, I've gotten into the habit of CTRL+Right Click while the command is active then just pressing the corresponding key for whichever snap I need for that particular function that isn't already in my OSNAP setting. Takes less than a second to override now that I've gotten it to muscle memory, but I can definitely see how it would get rough when needing to select, say, perpendicular or endpoint 25-50 times in one command. Though, keyboard macros have saved my fingers plenty in those situations... One for MID>Enter, one for PERP>Enter, one for END>Enter.

I'm gonna give these LISPs a shot though. I'm always down for experimenting with a new method.

Share this post


Link to post
Share on other sites
BIGAL

If its something you want to force inside a program like a point is to be perp then just change the variable Osmode to correct value in your code.

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