Boolean functions in Lisp?
Boolean functions in Lisp?
(OP)
G'day All,
Please find below a basic cube lisp routine. My question is how do I add a hole through the centre of the cube through each 6 sides. The hole is to be 1/10th the cube size.
Thanks for any help.
Cheers
Mike
(defun C:CUBE (/ point1 cubesize1)
(setq cubesize1 (RTOS (getreal "\nWhat size is the cube: ")))
(setq point1 (getpoint "\nPick insertion point: "))
(command "rectangle"
point1
(strcat "@" cubesize1 "," cubesize1)
"extrude"
"last"
""
cubesize1
""
)
(princ)
)
Please find below a basic cube lisp routine. My question is how do I add a hole through the centre of the cube through each 6 sides. The hole is to be 1/10th the cube size.
Thanks for any help.
Cheers
Mike
(defun C:CUBE (/ point1 cubesize1)
(setq cubesize1 (RTOS (getreal "\nWhat size is the cube: ")))
(setq point1 (getpoint "\nPick insertion point: "))
(command "rectangle"
point1
(strcat "@" cubesize1 "," cubesize1)
"extrude"
"last"
""
cubesize1
""
)
(princ)
)





RE: Boolean functions in Lisp?
The following program does all you need.
(defun c:CH(/ bp bl bc osflag)
(setq bp (getpoint "\n Box position: "))
(command "ucs" "m" bp)
(setq bl (getdist '(0 0 0) "\n Length: "))
(if (<= (getvar "osmode") 16383)
(progn
(setvar "osmode"
(+ (getvar "osmode") 16384)
)
(setq osflag t)
)
)
(command "rectangle" '(0 0) "d" bl bl "@")
(command "extrude" "l" "" bl "")
(setq bc (list (/ bl 2)
(/ bl 2)
(caddr bp)
))
(command "circle" bc (/ bl 10))
(command "extrude" "l" "" bl "")
(command "subtract" '(0 0) "" "l" "")
(command "ucs" "n" "x" "")
(command "circle" bc (/ bl 10))
(command "extrude" "l" "" (* bl -1) "")
(command "subtract" '(0 0) "" "l" "")
(command "ucs" "n" "y" "-90")
(setq bc (list (* (car bc) -1)
(cadr bc)
(caddr bc)
))
(command "circle" bc (/ bl 10))
(command "extrude" "l" "" (* bl -1) "")
(command "subtract" '(0 0) "" "l" "")
(command "ucs" "p" "ucs" "p" "ucs" "p")
(if osflag
(setvar "osmode"
(- (getvar "osmode") 16384)
)
)
(princ)
)
Good Luck,
Farzad
RE: Boolean functions in Lisp?
I shall study the code to see how I get over this next hill. Thanks again.
Cheers
Mike