plecs Posted March 9, 2014 Posted March 9, 2014 I am stuck not understand how you must separate the first IPT, I read about car cdr cadr caddr I do not give out all the other point that should do (defun c:cp1mm () ;imput (setvar "Cmdecho" 0) (setq ipt (getpoint"\nSelect the bottom left point: ")) (setq lun (getreal "\nLength ofcabinet :")) (setq adc (getreal "\nDepth of cabinet : ")) (setq hinal (getreal "\nHeight cabinet: ")) (setq nrc (getreal "\nNumber of cabinet: ")) (setq thc (getreal "\nThickness of cabinet: ")) (setq gpfl (getreal "\nThickness of PFL: ")) (progn (setq lun1 (- lun (* thc 2)))) (setq lun_pfl (- lun thc)) (setq lat_pfl (- hinal thc)) (command "_.box" "_non" ipt "L" thc hinal adc) (command "_.box" "_non" ipt1 "L" lun1 thc adc) (command "_.box" "_non" ipt2 "L" thc hinal adc) (command "_.box" "_non" ipt3 "L" lun1 thc adc) (command "_.box" "_non" ipt4 "L" lun_pfl lat_pfl gpfl) (setvar "Cmdecho" 1) (princ) ) plase help me with my code Quote
ReMark Posted March 9, 2014 Posted March 9, 2014 Maybe you can study the code behind this lisp program that will draw 2D cabinet elevations to gain some further insight. http://cadtips.cadalyst.com/2d-operations/draw-cabinet-elevations Quote
BIGAL Posted March 10, 2014 Posted March 10, 2014 very simple (setq ipt (getpoint"\nSelect the bottom left point: ")) (setq x (car ipt)) (setq y (cadr ipt)) (setq z (caddr ipt)) ;To put back together (setq newpt (list x y z )) ; do not really need z ;alternative (setq x (nth 0 ipt)) (setq y (nth 1 ipt)) (setq z (nth 2 ipt)) ; a box (setq toprt (list (+ x lun) (+ y hinal))) 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.