Jump to content

Need a lisp....... Lee Mac this ones for you


Recommended Posts

Posted

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

  • Replies 94
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    35

  • MikeP

    31

  • CAB

    11

  • Se7en

    9

Top Posters In This Topic

Posted Images

Posted

Se7en,

 

I am trying to understand your code, but will the Boole expression not just output 0/1?

Posted

yes BUT thats what you want (Your "flipping a bit").

 

brb...

Posted

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).

Posted
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 :)

Posted

Yes, I used it as you describe, and only get 1 or 0, as expected by the boole expression.

Posted

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)
)

Posted
Mike try this:

 

V1.3 : Added options to change line dimensions.

 

 

Thats perfect, but it only lets you change the vertical offset

Posted
Thats perfect, but it only lets you change the vertical offset

 

Everything works fine for me... :huh:

Posted
Everything works fine for me... :huh:

 

 

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

Posted

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

Posted

I never use the "drop-down" so wasn't sure about that. But glad you got it sorted.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...