Se7en Posted August 6, 2009 Posted August 6, 2009 I started to look at the code in v3 but i got so confused i had to stop. However, while i had the file open i noticed a lot of osnap checking and conditions and whatnot so i thought i would toss this out there to see if it could help. If all you want is to ensure the osnaps are off when they are supposed to be then you can use boole 3 in a quick toggle procedure. REMOVED: its wrong HTH Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 Se7en, I am trying to understand your code, but will the Boole expression not just output 0/1? Quote
Se7en Posted August 6, 2009 Posted August 6, 2009 yes BUT thats what you want (Your "flipping a bit"). brb... Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 But surely you don't want to be setting OSMODE to 1...? Quote
Se7en Posted August 6, 2009 Posted August 6, 2009 Your not setting the osmode to 1. Did you try it? ... never mind. Here is a real quick explanation to its inner workings (A real quick "Flipping bits" lesson). If my current osmode value was say 247 then this is how it would look in binary notation. 16384: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 247: 0 0 0 0 0 0 0 1 1 1 1 0 1 1 1 ^ | +----- I'm "flipping" this bit in the current osmode value Flipping the 16384 bit is like hitting . Hows that sound? Cool huh? I'll find an article which will explain it better. brb (be right back). Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 Your not setting the osmode to 1. Did you try it? ... never mind. Here is a real quick explanation to its inner workings (A real quick "Flipping bits" lesson). If my current osmode value was say 247 then this is how it would look in binary notation. 16384: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 247: 0 0 0 0 0 0 0 1 1 1 1 0 1 1 1 ^ | +----- I'm "flipping" this bit in the current osmode value Flipping the 16384 bit is like hitting . Hows that sound? Cool huh? I'll find an article which will explain it better. brb (be right back). Yes, I tried it, and I could only get it to set OSMODE to 0 or 1... hence my queries.. I understand your logic and yes that is pretty cool Quote
Se7en Posted August 6, 2009 Posted August 6, 2009 *blink-blink* what do you mean you could only get it to set osmode to 1 or 0? Did you use the procedure like: (toggleOsnap 1) or (toggleOsnap 0)? http://www.afralisp.net/lisp/binary_I.htm Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 Yes, I used it as you describe, and only get 1 or 0, as expected by the boole expression. Quote
Se7en Posted August 6, 2009 Posted August 6, 2009 Sorry, had a fire to put out here (and lunch). Yeah, i screwed up. Im sorry. Would this be better? Its not Boole 3...its more like Boole 2 or 7 depending but the same concept. (defun toggleOsnap (value) ;; if `value' = 1 then turn osnaps off ;; if `value' = 0 then turn osnaps on ;; (setvar "OSMODE" (boole (+ 2 (* value 5)) (getvar "OSMODE") 16384)) (princ) ) Quote
MikeP Posted August 7, 2009 Author Posted August 7, 2009 Mike try this: V1.3 : Added options to change line dimensions. Thats perfect, but it only lets you change the vertical offset Quote
Lee Mac Posted August 7, 2009 Posted August 7, 2009 Thats perfect, but it only lets you change the vertical offset Everything works fine for me... Quote
MikeP Posted August 7, 2009 Author Posted August 7, 2009 Everything works fine for me... The drop down after change defaults only list exit and V. Should it list the other values as well? after I change the V, it goes back to "exit & V" If I click exit, it goes into point selection Quote
MikeP Posted August 7, 2009 Author Posted August 7, 2009 never mind, I just realized what i was missing, on the screen, the dropdown down not include the other values, but in the command line it does. All is well now Thanks alot man Quote
Lee Mac Posted August 7, 2009 Posted August 7, 2009 I never use the "drop-down" so wasn't sure about that. But glad you got it sorted. Quote
Recommended Posts
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.