running osnaps...

Discussion in 'AutoCAD' started by aaron weissner, Jan 21, 2004.

  1. how do i get a list of what osnaps are currently turned on, save the list,
    and restore the snaps at a later time...
     
    aaron weissner, Jan 21, 2004
    #1
  2. aaron weissner

    ECCAD Guest

    (setq old_snap_mode (getvar "OSMODE"))
    More code here..
    (setvar "OSMODE" old_snap_mode); reset

    Bob
     
    ECCAD, Jan 21, 2004
    #2
  3. aaron weissner

    Devin Guest

    The "OSMODE" variable holds the values in a bit sequence that can be
    manipulated via LOGAND and LOGIOR. The following is some old code (and yes
    a bit un-optimized) but it will actually generate a list of osnaps in string
    format from the supplied osmode variable. Maybe that will help?

    Devin

    (defun get_osnap_list ( ed_arg / ed_wrk ed_oslist ed_osnap ed_list)
    (setq ed_osnap ed_arg)
    (setq ed_list "")
    (if
    (>= ed_osnap 16384)
    (setq ed_list nil)
    (progn
    (setq ed_oslist
    '(
    (8192 "_par")
    (4096 "_ext")
    (2048 "_app")
    (1024 "_qui")
    (512 "_nea")
    (256 "_tan")
    (128 "_per")
    (64 "_ins")
    (32 "_int")
    (16 "_qua")
    (8 "_nod")
    (4 "_cen")
    (2 "_mid")
    (1 "_end")
    )
    )
    (foreach ed_wrk ed_oslist
    (if
    (>= ed_osnap (car ed_wrk))
    (progn
    (if
    (equal ed_list "")
    (setq ed_list (cadr ed_wrk))
    (setq ed_list (strcat ed_list "," (cadr ed_wrk)))
    )
    (setq ed_osnap (- ed_osnap (car ed_wrk)))
    )
    )
    )
    )
    )
    (setq ed_list ed_list)
    )
     
    Devin, Jan 21, 2004
    #3
  4. oh yeah, i remember reading something about that... thank you...
     
    aaron weissner, Jan 21, 2004
    #4
  5. aaron weissner

    Devin Guest

    Anytime :)
     
    Devin, Jan 21, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.