- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi sir/mam
I have lisp for place labels of length for multiple polylines (vertex to vertex) at once.
but I want "length of full polylines (not vertex to vertex) and after selection of polylines it will ask for distance to place labels from middle of full polylines.
here lisp in text format or download lisp file below.
(defun c:plla (/ _Text s)
(defun _Text (p a d)
(entmakex (list '(0 . "TEXT")
(cons 10 (trans p 1 0))
(cons 11 (trans p 1 0))
(cons 1 (rtos d 2))
(cons 50 a)
'(40 . 2.)
(cons 7 (getvar 'textstyle))
'(71 . 0)
'(72 . 1)
)
)
)
(if (setq s (ssget '((0 . "LINE,LWPOLYLINE"))))
((lambda (i / e sn pt p p1 p2 st nd ang)
(while (setq sn (ssname s (setq i (1+ i))))
(setq e (entget sn))
(if (eq (cdr (assoc 0 e)) "LWPOLYLINE")
(progn (setq pt 0)
(repeat (- (fix (vlax-curve-getendparam sn)) (fix (vlax-curve-getstartparam sn)))
(setq p (mapcar (function (lambda (j k) (/ (+ j k) 2.)))
(setq p1 (vlax-curve-getpointatparam sn pt))
(setq p2 (vlax-curve-getpointatparam sn (setq pt (1+ pt))))
)
)
(_Text p (angle p1 p2) (distance p1 p2))
)
)
(progn (setq ang (angle (setq st (cdr (assoc 10 e))) (setq nd (cdr (assoc 11 e)))))
(_Text (mapcar (function (lambda (j k) (/ (+ j k) 2.))) st nd) ang (distance st nd))
)
)
)
)
-1
)
)
(princ)
)
Solved! Go to Solution.