does anyone know the lisp that allows you to select several lines or polylines and adds the total linear length
|
does anyone know the lisp that allows you to select several lines or polylines and adds the total linear length
Welcome to AUGI!
Here's one I wrote a while ago:
Edit - This will count the total length for Arcs, Lines, and *Polylines.Code:(defun c:LENT () (c:LengthTotal)) (defun c:LengthTotal ( / ss) (princ "\rLENGTH: TOTAL ") (vl-load-com) (if (setq ss (ssget "_:L" '((0 . "ARC,LINE,*POLYLINE")))) ((lambda (i / o) (vlax-for x (setq ss (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)))) (cond ((vl-position (setq o (vla-get-objectname x)) '("AcDbLine" "AcDbPolyLine")) (setq i (+ i (vla-get-length x)))) ((= "AcDbArc" o) (setq i (+ i (vla-get-arclength x)))))) (prompt (strcat "\nTotal Length >> " (rtos i 2 2))) (vla-delete ss)) 0) (prompt "\n** Nothing selected ** ")) (princ))
HTH
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Thanks! I've been out of the design for a few years but now I'm back in it. New Year = New Goals...
Thanks for the lisp, I'll try it out.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
@RM:
Also, there's no reason to filter out objects on locked layers.Code:(vlax-curve-getDistAtParam <ename> (vlax-curve-getEndParam <ename>))
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000