Author Topic: Drafting Settings  (Read 2055 times)

0 Members and 1 Guest are viewing this topic.

Coder

  • Swamp Rat
  • Posts: 827
Drafting Settings
« on: September 19, 2011, 12:55:07 AM »
Hello .

The value of my current osmode is 4143 and the MidPoint option is checked ( is on ) .

How can I know MidPoint option is check or not in my drafting settings through the value of the osmode  ?

Many thanks

kruuger

  • Swamp Rat
  • Posts: 637
Re: Drafting Settings
« Reply #1 on: September 19, 2011, 01:17:52 AM »
Hello .

The value of my current osmode is 4143 and the MidPoint option is checked ( is on ) .

How can I know MidPoint option is check or not in my drafting settings through the value of the osmode  ?

Many thanks
Code: [Select]
(defun c:test ()
  (if (zerop (logand 2 (getvar "osmode")))
    (princ "\n MID snap off")
    (princ "\n MID snap on")
  )
  (princ)
)
k.

pBe

  • Bull Frog
  • Posts: 402
Re: Drafting Settings
« Reply #2 on: September 19, 2011, 01:25:56 AM »
another

(setvar 'osmode (boole 6 2 (getvar 'osmode)))

Toggle MID on and off

Coder

  • Swamp Rat
  • Posts: 827
Re: Drafting Settings
« Reply #3 on: September 19, 2011, 01:46:19 AM »
Thank you so much guys ,

That's great .




CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Drafting Settings
« Reply #4 on: September 19, 2011, 09:08:35 AM »
Here is an oldie.
Code: [Select]
;;  CAB  10/5/2006
;;
;;  Function to return the current osmode setting in the form of a string
;;  If (getvar "osmode") = 175
;;  (get_osmode)  returns   "_end,_mid,_cen,_nod,_int,_per"
;;  Usage
;;  (osnap (getpoint) (get_osmode))
;;
(defun get_osmode (/ cur_mode mode$)
  (setq mode$ "")
  (if (< 0 (setq cur_mode (getvar "osmode")) 16383)
    (mapcar
      '(lambda (x)
         (if (not (zerop (logand cur_mode (car x))))
           (setq mode$ (strcat mode$ (cadr x)))
         )
       )
      '((0 "_non,")  (1 "_end,")   (2 "_mid,")   (4 "_cen,")   (8 "_nod,")
        (16 "_qua,") (32 "_int,")  (64 "_ins,")  (128 "_per,") (256 "_tan,")
        (512 "_nea,")(1024 "_qui,")(2048 "_app,")(4096 "_ext,")(8192 "_par")
       )
    )
  )
  mode$
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Coder

  • Swamp Rat
  • Posts: 827
Re: Drafting Settings
« Reply #5 on: September 19, 2011, 09:36:44 AM »
Very nice routine Mr CAB.

Thanks a lot .

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Drafting Settings
« Reply #6 on: September 19, 2011, 10:53:53 AM »
You're welcome.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Dinosaur

  • Guest
Re: Drafting Settings
« Reply #7 on: September 19, 2011, 11:19:28 AM »
Hello .

The value of my current osmode is 4143 and the MidPoint option is checked ( is on ) .

How can I know MidPoint option is check or not in my drafting settings through the value of the osmode  ?

Many thanks
All are fine codes, but I believe that every possible combination of O-SNAP settings has a unique numerical value for OSMODE.  Thus, if your OSMODE value is indeed found to be 4143 your MidPoint setting must be checked or "ON" by definition.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Drafting Settings
« Reply #8 on: September 19, 2011, 11:44:24 AM »
Hello .


How can I know MidPoint option is check or not ...??
when it doesn't SNAP to an object's Mid-point would be a good check.    ;-)
Be your Best


Michael Farrell
http://primeservicesglobal.com/