Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello people.
I found this code in internet searches and I'm trying to modify it for my operation, but due to little experience I can't.
how can I modify it so that the code has the same function but does not have the corners like this (photo below) similar to the MLINE command but with the texts
(defun c:TEST ( / slc pti ptn ptc ang mid ptn inf tmp dis num idx stp ent )
;;++++++++++++++++++++++++++++++++++++++++++++++++++++;;
(defun *error* ( msg )
(if (not (member msg '("Function cancelled" "quit / exit abort")))
(princ (strcat "\nError: " msg))
)
(command-s "_.Undo" "_End")
(princ)
)
(command-s "_.Undo" "_Begin")
(initget 128 "Width")
(setq rtr (vl-catch-all-apply 'getpoint (list "\nClick on the starting point or [Width] ")))
(if (= (type rtr) 'vl-catch-all-apply-error)
(progn
(alert (strcat "Error: " (vl-catch-all-error-message rtr)))
(exit)
)
(cond
( (= rtr nil)
(alert "ERROR: \nNo point was chosen.")
(exit)
)
( (= (type rtr) 'LIST)
(setq pti rtr)
)
( (= (type rtr) 'STR)
(if (setq lar (getdist (strcat "\nWidth <" (rtos (getvar 'cmlscale) 2 2) ">: ")))
(setq scl (setvar 'cmlscale lar))
)
(setq pti (getpoint "\nClick the starting point:"))
)
)
)
(while t
(setq ptn (getpoint pti "\nClick next point: "))
(setq ang (angle pti ptn)
mid (polar (mapcar (function (lambda (x y) (/ (+ x y) 2.0))) pti ptn) 5.0 (/ scl 2.0))
)
(setq id "ID: XXXX")
(if (and (> ang (/ pi 2)) (< ang (* 1.5 pi)))
(setq ang (+ ang pi))
)
(setq dis (distance pti ptn))
(cond
( (< 0 dis 80 ) (setq num 0))
( (< 80 dis 200 ) (setq num 1))
( (< 200 dis 400) (setq num 2))
( (< 400 dis 800) (setq num 3))
( (< 800) (setq num 4))
)
(setq stp (/ dis (+ num 1)))
(setq idx 1 )
(repeat num
(setq ptc (polar pti (angle pti ptn) (* idx stp)))
(setq ptc (polar ptc (- (angle pti ptn) (/ pi 2)) (/ scl 2.0)))
(vl-cmdf "_.Text" "_Justify" "_MC" ptc 2.5 (/ (* ang 180.0) pi) id )
(setq idx (1+ idx))
)
(vl-cmdf "_.Mline" pti ptn "")
(if (not (eq ent (setq ent (entlast))))
(vl-cmdf "_.explode" ent)
)
(setq pti (getvar 'lastpoint))
);aqui while
(command-s "_.Undo" "_End")
(princ)
)
Solved! Go to Solution.