Osnaps disappeared - how to activate all them in one time

Hi guys
could someone tell me the command line to activate all the OSNAP ? Sometime all the OSNAP disappear and I have to activate one by one. I ask if there is a command line to activate all them in one time.
Thanks for all the answers
Bye

Comments

  • The value of the currently active Entity Snaps is stored in the OSMODE (variable).
    The value is sum of the values of each selected (checked) Entity Snap.
    So in answer to your question is there a command line to activate all them in one time:
    yes type OSMODE on the command line and enter a value.

    New current value for OSMODE (0 to 32767) <35>:

    See settings dialog on osmode and within this dialog set each entity snap on one by one and confirm that the
    value of the 'Entity snap mode' is the sum of all 'checked' or 'set' individual entity snaps.

    Setting OSMODE to 32767 will set ALL entity snaps on.

    you could use following Lisp command to quickly revert to your 'favorite' set of entity snaps.

    (setvar "osmode" 32)
    (setvar "osmode" 32767)
    (setvar "osmode" 35)

  • @Ferdinand Janssens said:
    The value of the currently active Entity Snaps is stored in the OSMODE (variable).
    The value is sum of the values of each selected (checked) Entity Snap.
    So in answer to your question is there a command line to activate all them in one time:
    yes type OSMODE on the command line and enter a value.

    New current value for OSMODE (0 to 32767) <35>:

    See settings dialog on osmode and within this dialog set each entity snap on one by one and confirm that the
    value of the 'Entity snap mode' is the sum of all 'checked' or 'set' individual entity snaps.

    Setting OSMODE to 32767 will set ALL entity snaps on.

    you could use following Lisp command to quickly revert to your 'favorite' set of entity snaps.

    (setvar "osmode" 32)
    (setvar "osmode" 32767)
    (setvar "osmode" 35)

    Super !! Many thanks Ferdinand, you solved my little problem !!

  • btw @keko71,
    You can make that happen at startup, or by a key-in command, as many tools mess with osmode and leave it at 0.
    for startup, make a text file name "On_doc_load_default.lsp" and put in one of the top support paths.
    To check if you already have one, run (findfile "On_doc_load_default.lsp") on the command line.
    Once that is in place, add a startup function, with the osmode code in it:
    (defun S::STARTUP ( / )
    (SETVAR "OSMODE" 32)
    )

    change the 32 to whatever.
    To make a key-in to set that fast, maybe S32, add this below the previous code:
    (DEFUN C:S32 (PRINC "\nSet OSMODE to 32")(SETVAR "OSMODE" 32)(princ))

    the (DEFUN C: means "define function for command line",
    the S32 is the function you type to run it,
    the (PRINC "\nSet OSMODE to 32") is just a message for the command line to remind you what you did,
    the (SETVAR "OSMODE" 32) sets osmode,
    the (princ) prevents the return from previous function from printing on the command line,
    the last ) closes out the parens for the function.

    Then you can add many of the Sxx functions as desired, for each osmode setting you want, like
    (DEFUN C:S35 (PRINC "\nSet OSMODE to 35")(SETVAR "OSMODE" 35)(princ))

    all this is to save you typing "osmode" 32.
    Its also to show you how to set up key-ins using lisp, not acad.pgp which is so limited in what it can do.
    Happy LISPing!

  • keko71
    edited January 2019

    @James Maeding said:
    btw @keko71,
    You can make that happen at startup, or by a key-in command, as many tools mess with osmode and leave it at 0.
    for startup, make a text file name "On_doc_load_default.lsp" and put in one of the top support paths.
    To check if you already have one, run (findfile "On_doc_load_default.lsp") on the command line.
    Once that is in place, add a startup function, with the osmode code in it:
    (defun S::STARTUP ( / )
    (SETVAR "OSMODE" 32)
    )

    change the 32 to whatever.
    To make a key-in to set that fast, maybe S32, add this below the previous code:
    (DEFUN C:S32 (PRINC "\nSet OSMODE to 32")(SETVAR "OSMODE" 32)(princ))

    the (DEFUN C: means "define function for command line",
    the S32 is the function you type to run it,
    the (PRINC "\nSet OSMODE to 32") is just a message for the command line to remind you what you did,
    the (SETVAR "OSMODE" 32) sets osmode,
    the (princ) prevents the return from previous function from printing on the command line,
    the last ) closes out the parens for the function.

    Then you can add many of the Sxx functions as desired, for each osmode setting you want, like
    (DEFUN C:S35 (PRINC "\nSet OSMODE to 35")(SETVAR "OSMODE" 35)(princ))

    all this is to save you typing "osmode" 32.
    Its also to show you how to set up key-ins using lisp, not acad.pgp which is so limited in what it can do.
    Happy LISPing!

    thanks so much James Maeding , I will follow your suggestions soon !

  • ....Sometimes all the OSNAPs disappear ....

    That's usually because you used a custom command which temporarily set OSMODE=0, and then ended unexpectedly before it had a chance to restore OSMODE to what it was before. And it didn't include an error handler to take care of that possibility.

    If you can figure out which command is doing that, then you can post the lisp or other code here and someone can tell you how to add an error handler. Then it won't happen any more.

    It might be happening when you have to cancel a command because something went wrong. Or when a command is cancelled by Bricscad, with an error message. Watch for the ESNAP button at the bottom of the screen turning gray without you clicking on it.

  • @Anthony Apostolaros said:

    ....Sometimes all the OSNAPs disappear ....

    That's usually because you used a custom command which temporarily set OSMODE=0, and then ended unexpectedly before it had a chance to restore OSMODE to what it was before. And it didn't include an error handler to take care of that possibility.

    If you can figure out which command is doing that, then you can post the lisp or other code here and someone can tell you how to add an error handler. Then it won't happen any more.

    It might be happening when you have to cancel a command because something went wrong. Or when a command is cancelled by Bricscad, with an error message. Watch for the ESNAP button at the bottom of the screen turning gray without you clicking on it.

    Yes, Anthony you are perfectly right.
    That happen only when I close the command roughly wuthout follow the indication on the task bar that says "press x for exit". I have only to change my behaviour with BricsCad. Anyway in order to solve the problem quikly I have setted up a simple command button that activate the OSNAP in one clic.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!