Results 1 to 3 of 3

Thread: LISP to get total length including ARC, Pline & lines?

  1. #1
    Login to Give a bone
    0

    Default LISP to get total length including ARC, Pline & lines?

    Hi frnds..
    i have a lisp file that can LIST the the total length of lines.(only lines; it dosent support pline,arc etc.)

    anyone using (or can create) a lisp to get total lenght including ARC, Pline & lines?
    i can attach the lisp file i have(linesum.lsp)
    Attached Files Attached Files

  2. #2
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: LISP to get total length including ARC, Pline & lines?

    Hi

    Have you tried the Forum search facility -

    Search Forums

    A quick search returned the following (hopefully will get you going in the right direction) -

    Total polyline length

    Multiple Pline Calculation

    Does a sum or total length feature exist?

    Have a good one, Mike

  3. #3
    100 Club
    Join Date
    2000-12
    Posts
    126
    Login to Give a bone
    0

    Default Re: LISP to get total length including ARC, Pline & lines?

    Otherwise, here's a simple start if you want to write your own:
    Code:
    (defun C:SUMIT (/ ent dist endPar obj otype sum)
      (setvar "ERRNO" 0)
      (setq sum 0.0)
      (while (and (not (vl-catch-all-error-p
                      (setq ent (vl-catch-all-apply 'entsel))))
                  (/= (getvar "ERRNO") 52))
        (setq obj    (vlax-ename->vla-object (car ent)))
        (cond ((not (vl-catch-all-error-p
                   (setq endPar (vl-catch-all-apply 'vlax-curve-getEndParam (list obj)))))
               (setq dist  (vlax-curve-getDistAtParam obj endPar)
                     sum   (+ sum dist)
                     otype (vla-get-objectName obj)
               )
               (mapcar 'princ (list "\nAdding " otype ": " dist)))
              (T (princ "\nObject has no length definition"))
        )
      )
      (princ "\nTotal length: ")(princ sum)
      (princ)
    )

Similar Threads

  1. Total Pline Length Tracked in Dwg with Fields?
    By dwknutson in forum AutoLISP
    Replies: 5
    Last Post: 2017-10-10, 01:48 PM
  2. Lisp for Total Length of Polylines
    By issabhazboun708277 in forum AutoLISP
    Replies: 1
    Last Post: 2015-09-08, 03:56 PM
  3. DIM Pline by total length?
    By cadtag in forum AutoLISP
    Replies: 1
    Last Post: 2014-08-04, 04:25 PM
  4. add and total lines/pline
    By CADiver in forum AutoLISP
    Replies: 10
    Last Post: 2012-01-18, 07:07 PM
  5. Calculating total length of lines
    By wmmccully in forum AutoCAD General
    Replies: 3
    Last Post: 2006-01-18, 03:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •