Jump to content

intertion point can someone help me to continue to lisp code


plecs

Recommended Posts

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

Link to comment
Share on other sites

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


Link to comment
Share on other sites

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