Can according to the linear length automatic numbering, the next thing to do is set the permissible error reduce number type and output the results, DWG file on the right side of the Numbers is done in other programs, the following is written in my program, the right of the program is to allow the error is set to 5 mm.
Can you tell me if there is a program under how to modify to get the results I want?
(defun c:test(/ ss num e elist v10 v11 pt1 pt2)
(svos)
(if (= num nil) (setq num 1))
(setvar "osmode" 0)
(if (setq ss (ssget '((0 . "LINE"))))
(progn
(repeat (setq i (sslength ss))
(setq e (ssname ss (setq i (1- i))))
(setq eList (entget e))
(setq v10 (cdr (assoc 10 eList)))
(setq v11 (cdr (assoc 11 eList)))
;(setq disList (cons (distance v10 v11) disList))
(setq pt1 (polar v10 (angle v10 v11) (/(distance v10 v11) 2.0)))
(setq pt2 (polar pt1 (+ (angle v10 v11) (/ pi 2.0)) 300))
(command "text" "j" "m" pt2 300 (* (/ (angle v10 v11) pi) 180) (strcat "L-" (itoa num)))
(setq num (+ num 1))
)
)
)
(clos)
(princ)
)
(defun svos ()
(setq oldosm (getvar "OSMODE")
oldoth (getvar "ORTHOMODE")
oldlye (getvar "CLAYER")
oldclr (getvar "CECOLOR")
plnwid (getvar "PLINEWID")
oldltp (getvar "CELTYPE")
)
)
(defun clos ()
(setvar "OSMODE" oldosm)
(setvar "ORTHOMODE" oldoth)
(command "LAYER" "SET" oldlye "")
(setvar "CECOLOR" oldclr)
(setvar "PLINEWID" plnwid)
(setvar "CELTYPE" oldltp)
(princ)
)