TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ScottMC on September 26, 2022, 07:52:58 PM

Title: Not my field [just don't have I.T.]
Post by: ScottMC on September 26, 2022, 07:52:58 PM
Hopes are someone has done this and can just forward me.. can't get the 'check' to show when this OSMODE is set.
ID_OsnapNone   [$(if,$(!=,$(and,$(getvar,OSMODE),    0),0),!.)None    non]_non
......................................The others [other than this /0\ thing] work fine. How else to call/get? Help..
Title: Re: Not my field [just don't have I.T.]
Post by: tombu on September 28, 2022, 10:21:49 AM
In my Osnap Cursor Menu I use this macro that displays if Osmode is set to None and toggles it On when selected:
Display Name      $(if,$(=,0,$(getvar,osmode)),!.)None
Command Name  None
Macro                 ^C^C^P'setvar;osmode;0 ^P
Image                 RCDATA_16_OSNNON
Title: Re: Not my field [just don't have I.T.]
Post by: ScottMC on September 28, 2022, 11:07:13 AM
this is where it doesn't work [wheel click]
 
Code: [Select]
***POP0
**SNAP
               [Object Snap Cursor Menu]
;
;
ID_Cancel      [          *Cancel*]^C^C
               [--]
ID_OsnapNear   [$(if,$(!=,$(and,$(getvar,OSMODE),  512),0),!.)Nearest nea]_nea
ID_OsnapNone   [$(if,$(!=,$(and,$(getvar,OSMODE),    0),0),!.)None non]_non
ID_OsnapEndp   [$(if,$(!=,$(and,$(getvar,OSMODE),    1),0),!.)Endpoint end]_endp
ID_OsnapMidp   [$(if,$(!=,$(and,$(getvar,OSMODE),    2),0),!.)Midpoint mid]_mid
ID_LastPoinp   [Lastpoint_@]@;
;
;
Title: Re: Not my field [just don't have I.T.]
Post by: tombu on September 28, 2022, 11:50:00 AM
That's because None means No Osnaps are active meaning OSMODE must equal 0.
All other Osnaps may be toggled on/off without affecting the others but setting None turns off all Osnaps.
Change it to
Code: [Select]
$(if,$(=,0,$(getvar,osmode)),!.)None
Title: Re: Not my field [just don't have I.T.]
Post by: ScottMC on September 28, 2022, 12:19:52 PM
Magnificent!  Works perfect. Thanks Much. This part of understanding is under lisp major. So glad theswamp survived its oops/clean-up over the weekend!