I try to get a list of legth and radius
Result could be:
Totallength: 223.55 m
Radius 1: 25m
Radius 0.5: 10 m
and put the data as text to line-entity.
Here is my trial.
Code:
(defun c:st (/ #SS #Len)
(vl-load-com)
(princ "\nSelect Arc, Line, LWPolyline object(s) to calculate total length: ")
(cond
((setq #SS (ssget '((0 . "ARC,LINE,LWPOLYLINE"))))
(or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))
(setq #Len 0.)
(initget "Yes No")
(setq AW (getkword "\nwith text [Yes/No]<No>:"))
(cond
((= AW "Yes")
(vlax-for x (setq #SS (vla-get-activeselectionset *AcadDoc*))
(cond ((eq (vla-get-objectname x) "AcDbArc")
(setq #Len (+ #Len (vla-get-ArcLength x)))
(command "text" (vlax-curve-getStartPoint x) "0.375" "" (rtos(vla-get-ArcLength x)2 2))
)
((vl-position (vla-get-objectname x) '("AcDbLine" "AcDbPolyline"))
(setq #Len (+ #Len (vla-get-Length x)))
(command "text" (vlax-curve-getStartPoint x) "0.375" "" (rtos(vla-get-Length x)2 2))
)
);cond
); vlax-for
(total)
)
('T
(vlax-for x (setq #SS (vla-get-activeselectionset *AcadDoc*))
(cond ((eq (vla-get-objectname x) "AcDbArc")
(setq #Len (+ #Len (vla-get-ArcLength x)))
)
((vl-position (vla-get-objectname x) '("AcDbLine" "AcDbPolyline"))
(setq #Len (+ #Len (vla-get-Length x)))
)
); cond
); vlax-for
(total)
)
);cond
;;; (vla-delete #SS)
)
);cond
)
(defun total ()
(alert (strcat "Total Length: "(setvar 'users5 (rtos #Len))
) ;_ strcat
) ;_ alert
(princ)
)