Hello i have a problem, I need to make project in autocad.
The drawing is simple but my problem is autolisp. I barelly understand autolisp and our teacher doesn't really explain anything (sometimes I think that he himself doesn't know how to do it) . What do I have to do? I have 1 drawing with entmake function. This is a example, plase hellp meee!!
Code:
(defun desen ()
(setq latime (getreal "\nDati latimea: "))
(while (< latime 0.)
(setq latime (getreal "\nDati o valoare pozitiva: "))
)
;cota2
(setq val_min (* 1.8 latime))
(setq val_max (* 2.2 latime))
(princ "\nDati lungimea ( ")
(princ val_min)
(princ " .. ")
(princ val_max)
(princ " ):")
(setq lungime (getreal))
(while (< lungime val_min)
(setq lungime (getreal "\nDati o valoare mai mare decat valoarea minima: "))
)
(while (> lungime val_max)
(setq lungime (getreal "\nDati o valoare mai mica decat valoarea maxima: "))
)
;cota3
(setq val_min (* 0.4 latime))
(setq val_max (* 0.6 latime))
(princ "\nDati inaltimea ( ")
(princ val_min)
(princ " .. ")
(princ val_max)
(princ " ):")
(setq inaltime (getreal))
(while (< inaltime val_min)
(setq inaltime (getreal "\nDati o valoare mai mare decat valoarea minima: "))
)
(while (> inaltime val_max)
(setq inaltime (getreal "\nDati o valoare mai mica decat valoarea maxima: "))
)
;cota4
(setq val_min (* 0.3 latime))
(setq val_max (* 0.5 latime))
(princ "\nDati diametrul cilindrului ( ")
(princ val_min)
(princ " .. ")
(princ val_max)
(princ " ):")
(setq diam (getreal))
(while (< diam val_min)
(setq diam (getreal "\nDati o valoare mai mare decat valoarea minima: "))
)
(while (> diam val_max)
(setq diam (getreal "\nDati o valoare mai mica decat valoarea maxima: "))
)
(command "osnap" "off")
(command "vpoint" "-1,-1,1")
(command "Color" "blue")
;;; (setq latime 62)
;;; (setq lungime 106)
;;; (setq inaltime 37)
;;; (setq diam 25)
(setq raza (/ diam 2))
(setq b1 (list 0. 0. ))
(setq b2 (list lungime 0))
(setq b3 (list lungime latime))
(setq b4 (list 0 latime))
(setq t1 (list (*(/ 80. 62) latime) 0))
(setq t2 (list (*(/ 80. 62) latime) latime))
(setq v1 (list (*(/ 88. 62) latime) 0))
(setq v2 (list (*(/ 88. 62) latime) latime))
(setq c1 (list latime (/ latime 2)))
(setq r1 (*(/ 12.5 62.) latime))
(entmake (list (cons 0 "polyline")
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b1)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b2)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b3)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b4)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b1)
)
)
(entmake (list(cons 0 "SEQEND")
)
)
(setq baza (entlast))
(entmake (list (cons 0 "polyline")
)
)
(entmake (list (cons 0 "vertex")
(cons 10 t1)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b2)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b3)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 t2)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 t1)
)
)
(entmake (list(cons 0 "SEQEND")))
(setq treapta (entlast))
(entmake (list (cons 0 "polyline")
)
)
(entmake (list (cons 0 "vertex")
(cons 10 v1)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b2)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 b3)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 v2)
)
)
(entmake (list (cons 0 "vertex")
(cons 10 v1)
)
)
(entmake (list(cons 0 "SEQEND")))
(setq varf (entlast))
(command "Color" "yellow")
(entmake (list (cons 0 "circle")
(cons 10 c1)
(cons 40 r1)
)
)
(setq cili (entlast))
(command "Color" "blue")
(command "extrude" baza "" (*(/ 18. 62) latime) "" 0 "")
(setq baza (entlast))
(command "extrude" treapta "" (*(/ 25. 62) latime) "" 0 "")
(setq treapta (entlast))
(command "extrude" varf "" inaltime "" 0 "")
(setq varf (entlast))
(command "Color" "yellow")
(command "extrude" cili "" inaltime "" 0 "")
(setq cili (entlast))
(command "subtract" baza "" cili "" )
(command "Color" "blue")
(command "union" baza treapta varf "")
(command "zoom" "a")
(command "ShadeMode" "o")
)
(defun c:pr ()
(desen)
)
(defun c:s ()
(command "undo" 200)
)
plase help mee
i attach pictures with my project plase is URGENT.