Jump to content

Recommended Posts

Posted

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.

Posted

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
Posted

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
Posted

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.

Posted

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.

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