DIM Pline by total length?
I need to apply dimensions to arbitrary pline segments for total length -- segments may include curves, reverse curves, straight line segments, etc in any combination. Total length I can get with a field, but any one have something simple to automate getting that length and adding arrowheads? preferably looking at the current DIMSTYLE for arrowhead, textstyle, and dimscale?
Basically i want this to look as much as possible like the remainder of the dimensions in the sheet.
Re: DIM Pline by total length?
I have what may be the exact same problem. I my case, these are pipe runs that I want to call-out the length of the polyline. I found this thread on AUGI,
http://forums.augi.com/showthread.ph...ected-Polyline
It has this LISP code,
(vl-load-com)
(defun C:GetLength (/ intCount entItem sngLength objItem)
(setq ssSelections
(ssget (list (cons 0 "*LINE,ARC")))
sngLength 0
)
(repeat (setq intCount (sslength ssSelections))
(setq intCount (1- intCount)
entItem (ssname ssSelections intCount)
objItem (vlax-ename->vla-object entItem)
sngLength (+ sngLength
(vlax-curve-getDistAtParam
objItem
(vlax-curve-getEndParam objItem)
)
)
)
)
sngLength
(if (zerop (cdr (assoc 40 (entget (tblobjname "style" (getvar
"textstyle"))))))
(vl-cmdf ".text" (getpoint "\nPick point for text ") (getvar
"textsize") 0.0 sngLength)
(vl-cmdf ".text" (getpoint "\nPick point for text ") 0.0
sngLength)
)
)
However, the text it inserts is not associative. I think I would prefer text that inserts a field with the polyline length, and I don't now how to do that. But, even a field in a MTEXT object will not automatically update unless you regenerate the drawing. So, I don't know of an ideal solution.
Also, note that while AutoCAD now can report the length and area as a property of a polyline for programs to use, I don't recall what year that was added.
-Joe