07-20-2021
04:36 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
07-20-2021
04:36 AM
If the answer to @3wood's question is that you would want all line segments the same length, which should not be more than 0.1 drawing units, but may be slightly shorter to divide equally and prevent a much-shorter one at the end, try this:
(defun C:A2PL ; = Arc(s) {to} Polylines of all Line segments
(/ maxseg ss n arc len segs seglen inc)
(setq maxseg (getdist "\nMaximum segment length: "))
(prompt "\nTo convert Arc(s) to Polyline(s) of Line segments,")
(if (setq ss (ssget "_:L" '((0 . "ARC"))))
(repeat (setq n (sslength ss))
(setq
arc (ssname ss (setq n (1- n)))
len (getpropertyvalue arc "length")
segs (/ len maxseg)
segs (+ (fix segs) (if (equal (rem len maxseg) 0 1e-4) 0 1))
seglen (/ len segs)
inc 0
); setq
(command "_.pline" "_non" (vlax-curve-getStartPoint arc) "_width" 0 0)
(repeat segs
(command "_non" (vlax-curve-getPointAtDist arc (* seglen (setq inc (1+ inc)))))
); repeat
(command "")
(entdel arc)
); repeat
); if
(princ)
); defun
(vl-load-com)
It could have the 0.1 unit maximum segment length built in, rather than ask for it, if you always use the same. And it could have the other usual enhancements, but first see whether it does what you want.
Kent Cooper, AIA