+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Apr 2009
    Posts
    34

    Default Total line length

    Registered forum members do not see this ad.

    I m working in large housing project and i wanted to measure total portabal water pipeline length which is nearly 40 km long....I did it getting dimensions part by part.....nearly 750 lines were there(same layer) is there any easy method to get total line length at once.......if so pl. explain ste by step......

  2. #2
    Super Member
    Computer Details
    Dipali's Computer Details
    Operating System:
    windows vista
    Computer:
    IBM Thinkpad lenovo
    CPU:
    Intel Centrino vPro
    Monitor:
    viewsonicVA1916w
    Discipline
    Architectural
    Dipali's Discipline Details
    Occupation
    ARCHITECTURE
    Discipline
    Architectural
    Details
    interiors
    Using
    AutoCAD 2009
    Join Date
    Dec 2007
    Location
    INDIA
    Posts
    1,077

    Default

    if you are familier with lisps there are lots of threads deiscussing this in lisps forum. I have no knwoledge of lisps, so can not guide you in right direction


    Alos look at the similr threads listed here at bottom of this this thread.
    "An architect's most useful tools are an eraser at the drawing board & a wrecking bar at the site."
    Frank Lloyd Wright

  3. #3
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,543
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  4. #4
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-4770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2015
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,930

    Default

    Quote Originally Posted by prabhathjp View Post
    I m working in large housing project and i wanted to measure total portabal water pipeline length which is nearly 40 km long....I did it getting dimensions part by part.....nearly 750 lines were there(same layer) is there any easy method to get total line length at once.......if so pl. explain ste by step......
    Download TLEN.LSP from http://www.turvill.com/t2/free_stuff/index.htm.
    If you don't know what to do with lisp files, see this.

  5. #5
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,081

    Default

    Or maybe this old one will rear it's head again.

    http://www.cadtutor.net/forum/showth...light=c%3Azone

    -David
    R12 (Dos) - A2K

  6. #6
    Senior Member Commandobill's Avatar
    Using
    AutoCAD 2014
    Join Date
    Oct 2008
    Location
    Raleigh, NC
    Posts
    319

    Default

    This wasn't created by me(I'm not very good with "vl") I obtained it at work. It extracts the distance of all polylines on all layers to an excel file.

    Code:
    (defun c:ple (/    elist     en      i       layer    layer_list
            leng     pline      row       ss        sumlen   total
            x     xlApp      xlBook   xlBooks  xlCells  xlSheet
            xlSheets
               )
      (vl-load-com)
      (setq    xlApp       (vlax-get-or-create-object "Excel.Application")
        xlBooks  (vlax-get-property xlApp "Workbooks")
        xlBook       (vlax-invoke-method xlBooks "Add")
        xlSheets (vlax-get-property xlBook "Sheets")
        xlSheet       (vlax-get-property xlSheets "Item" 1)
        xlCells       (vlax-get-property xlSheet "Cells")
      ) 
      (vla-put-visible xlApp :vlax-true)
      ;headers
      (vlax-put-property xlCells "Item" 1 1 "Layer")
      (vlax-put-property xlCells "Item" 1 2 "Length")
      
      (setq row 2
        total 0)
    
      (setq ss (ssget "_X" (list (cons 0 "*POLYLINE"))) i -1)
      (repeat (sslength ss)
        (setq en (ssname ss (setq i (1+ i)))
          elist (entget en)
          layer (cdr (assoc 8 elist)))
        (if (not (member layer layer_list))
          (setq layer_list (cons layer layer_list))))
      
      
      (repeat (length layer_list)
        (setq layer (car layer_list))
        (setq ss (ssget "_X" (list (cons 0 "*POLYLINE")(cons 8 layer))) i -1 sumlen 0)
        (repeat (sslength ss)
        (setq pline (vlax-ename->vla-object (ssname ss (setq i (1+ i)))))
        (setq leng  (vlax-curve-getdistatparam pline
              (vlax-curve-getendparam pline)))
        (setq sumlen (+ sumlen leng)))
        (vlax-put-property xlCells "Item" row 1 layer)
        (vlax-put-property xlCells "Item" row 2 (rtos sumlen 2 3))
        (setq total (+ total sumlen))
    ;;;    (vlax-put-property xlCells "Item" row 2 (rtos sumlen 2 3)); for metric units
        (setq layer_list (cdr layer_list))
        (setq row (+ row 1))
      ) 
      (setq row (+ row 1))
    ; footers:
    (vlax-put-property xlCells "Item" row 1 "Total:")
    (vlax-put-property xlCells "Item" row 2 (rtos total 2 3))
    ;;;(vlax-put-property xlCells "Item" row 2 (rtos total 2 3)); for metric units  
    
    (mapcar (function (lambda(x)
                (vl-catch-all-apply
                  (function (lambda()
                      (progn
                        (vlax-release-object x)
                        (setq x nil)))))))
    (list xlCells xlSheet xlSheets xlBook xlBooks xlApp)
    )
    (alert "Close Excel file manually")
    (gc)(gc)
    (princ)
      )
    (princ "\t\t***\t  Type PLE to write polines length to Excel\t***")
    (princ)
    ***Commandobill***
    Abusing AutoCad Since 1999
    "Caddatude... Do you has it?"
    Sorry for my poor English, I'm American...

  7. #7
    Senior Member Arizona's Avatar
    Computer Details
    Arizona's Computer Details
    Operating System:
    XP Prp
    Computer:
    Dell Precision 370
    RAM:
    2 Gig
    Graphics:
    NVIDIA GeForce 7800 GTX
    Monitor:
    2 17" Dells
    Using
    Land Desktop 2006
    Join Date
    Dec 2002
    Location
    South Jersey, USA
    Posts
    168

    Smile

    The attached asks you for a layer name and returns total length of all lines and arcs on that layer. I use it for roadway striping take-offs regularly.
    No Polylines for this routine though.
    Attached Files

  8. #8
    Luminous Being
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    5,437

    Default

    Make sure if your using a lisp that it is searching for all objects on a layer as Arizona hinted if it only searches for plines. You need a program that searches for arcs lines polylines lwplines 3dplines and adds all of them up. I am sure someone here has one will check one I have in VBA.

    One problem though with auto take offs you must be 100% confident that the drawing is correct we find the problem a lot where we have offset lines hence answer x 2.

  9. #9
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Apr 2009
    Posts
    34

    Default LISP Routine

    Registered forum members do not see this ad.

    Dear BIGAL.....
    Any how I could load ALEN'S routine well...now i know how to work with his routine....Now i want to know how to write these routines....can you help me please
    Many thanks to all friends here helping me at all

Similar Threads

  1. Various Line Length Total!!!
    By Cadet 84 in forum AutoCAD Drawing Management & Output
    Replies: 16
    Last Post: 20th Apr 2009, 09:32 am
  2. Total Length of Selection
    By YZ in forum AutoCAD General
    Replies: 5
    Last Post: 17th Jun 2008, 02:02 pm
  3. Total length of lines in Acad LT
    By dacoba in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 5
    Last Post: 26th Mar 2008, 06:52 pm
  4. Total length of specific lines
    By Yamma in forum AutoCAD General
    Replies: 1
    Last Post: 21st Aug 2006, 01:11 pm
  5. Total length
    By noddy in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 8th Jun 2006, 05:34 am

Bookmarks

Posting Permissions

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