need help on this drawing lisp (layers and dimension line ucs)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello all this is a lisp i wrote
(defun C:TP1()
(setq tac1 (getpoint "\n First point A "))
(setq tac2 (getpoint "\n Second point B "))
(setq a (getreal "\n Insert dimension a: "))
(setq b (getreal "\n Insert dimension b: "))
(setq c (getreal "\n Insert dimension c: "))
(setq d (getreal "\n Insert dimension d: "))
(setq rast (distance tac1 tac2))
(command "ucs" "3" tac1 tac2 "")
(setq t1 (list (- c) a 0))
(setq t2 (list (+ rast c) a 0))
(setq t3 (list (+ rast c) (- b) 0))
(setq t4 (list (- c) (- b) 0))
(setq t5 (list (- c) (- a d) 0))
(setq t6 (list (+ rast c) (- a d) 0))
(setq t7 (list 0 0 0))
(setq t8 (list rast 0 0))
(setq t9 (list (+ rast c) (+ 150 a) 0))
(setq t10 (list (- c) 0 0))
(setq t11 (list (/ rast 1.2) 0 0))
(setq t12 (list (+ rast c) (+ 100 a) 0))
(setq t13 (list 0 (+ 100 a) 0))
(setq t14 (list (+ rast c) 0 0))
(command "osnap" "none")
(command "pline" t1 t2 t3 t4 t1 "")
(command "_dimlinear" t1 t2 t9)
(command "_dimlinear" t1 t7 t13)
(command "_dimlinear" t8 t14 t12)
(command "_dimlinear" t4 t10 t11)
(command "_dimlinear" t10 t1 t11)
(command "line" t5 t6 "")
(command "line" t7 t8 "")
(command "osnap" "END,MID,INT,EXT,APP,CEN,NOD,QUA,INS,PER,TAN,NEA,PAR" "")
(command "ucs" "w")
)
I need help because i have a problem with dimension lines text which varies depending on the mode of entry points A and B. On picture bellow i have 4 ways of entry A and B points with dimension lines in white that is correct, dimension lines in purple that is incorrect (the text is upside down). I need that incorrect dimension lines should be like yellow dimension lines on picture. Also if i draw all of this in current layer i need help to make (command "line" t5 t6 "") to be draw in layer 2, and (command "line" t7 t8 "") to be draw in layer 3. after all is finish i need current layer from the start to be activate again.
Thank you very much for help and any other corrections in improving this lisp is welcome 🙂