@israel.shawEKTNS wrote:
I was using the tlenght by braudpat in message 5. But it turns out the ones that weren't working were 2D polylines. It's an easy conversion, so I'm good now. But it's worth noting the lsp doesn't work for 2D polylines
It just left out the term for those. But a lot of them can be combined into the same length determination. You can change this much:
((member (vla-get-objectname ent) '("AcDbLine" "AcDb3dPolyline" "AcDbPolyline"))
(setq di (+ di (vla-get-length ent)))
)
((eq (vla-get-objectname ent) "AcDbArc")
(setq di (+ di (vla-get-arclength ent)))
)
((eq (vla-get-objectname ent) "AcDbCircle")
(setq di (+ di (vla-get-circumference ent)))
)
((member (vla-get-objectname ent) '("AcDbSpline" "AcDbEllipse"))
(setq di (+ di (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent))))
)
to just this:
((member (vla-get-objectname ent)
'("AcDbLine" "AcDb3dPolyline" "AcDb2dPolyline" "AcDbPolyline"
"AcDbArc" "AcDbCircle" "AcDbSpline" "AcDbEllipse"))
(setq di (+ di (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent))))
)
Or:
((wcmatch (substr (vla-get-objectname ent) 5)
"Line,3dPolyline,2dPolyline,Polyline,Arc,Circle,Spline,Ellipse")
(setq di (+ di (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent))))
)
Kent Cooper, AIA