+ Reply to Thread
Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 49
  1. #1
    Senior Member RyanAtNelco's Avatar
    Computer Details
    RyanAtNelco's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Xenon
    RAM:
    6 gigs
    Graphics:
    ATI FirePro 2260
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    Burlington, MA
    Posts
    139

    Default Linetype length calculator

    Registered forum members do not see this ad.

    Hello,

    Is there anyone out there who can help me with a routine that selects all lines of a certain linetype, and displays the total length of all lines with that linetype? I was originally trying to do this with fields and a table but there are just too many lines in the particular file im working with, and i would like to be able to do this in general without setting up a field for every line.

    Thanks a million!

  2. #2
    Senior Member Commandobill's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2008
    Location
    Massachusetts
    Posts
    268

    Default

    Is each one of the linetypes 'bylayer' or are they all set seperately or a mix of both. *side note - I used to work in woburn...*
    ***Commandobill***
    Abusing AutoCad Since 1999
    "Caddatude... Do you has it?"
    Sorry for my poor English, I'm American...

  3. #3
    Senior Member RyanAtNelco's Avatar
    Computer Details
    RyanAtNelco's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Xenon
    RAM:
    6 gigs
    Graphics:
    ATI FirePro 2260
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    Burlington, MA
    Posts
    139

    Default

    As of right now they are set separately, but i was considering making new layers and setting it to "by layer". The issue with this is i would have to mess with my companies pen settings as all the standard colors are set, and my company is strict about modifying such things. Then everyone else would need the new pen settings, and as the low man on the totem pole i'd rather avoid company wide changes =).

  4. #4
    Senior Member RyanAtNelco's Avatar
    Computer Details
    RyanAtNelco's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Xenon
    RAM:
    6 gigs
    Graphics:
    ATI FirePro 2260
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    Burlington, MA
    Posts
    139

    Default

    where in woburn? im near the mall on gill st

  5. #5
    Senior Member Commandobill's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2008
    Location
    Massachusetts
    Posts
    268

    Default

    About 2 miles down the road. I worked at skyworks inc. Of course that was about 5 years ago. Ill see what i can make for you...
    ***Commandobill***
    Abusing AutoCad Since 1999
    "Caddatude... Do you has it?"
    Sorry for my poor English, I'm American...

  6. #6
    Senior Member RyanAtNelco's Avatar
    Computer Details
    RyanAtNelco's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Xenon
    RAM:
    6 gigs
    Graphics:
    ATI FirePro 2260
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    Burlington, MA
    Posts
    139

    Default

    your the man! i dont want to ask too much, but is there a way you can comment it out? i would like to learn how to make my own

  7. #7
    Senior Member Commandobill's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2008
    Location
    Massachusetts
    Posts
    268

    Default

    Sure. What do you plan on doing with the numbers once you get them? You want them in excel or a text file or somewhere in the dwg?
    ***Commandobill***
    Abusing AutoCad Since 1999
    "Caddatude... Do you has it?"
    Sorry for my poor English, I'm American...

  8. #8
    Senior Member RyanAtNelco's Avatar
    Computer Details
    RyanAtNelco's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Xenon
    RAM:
    6 gigs
    Graphics:
    ATI FirePro 2260
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    Burlington, MA
    Posts
    139

    Default

    excel would be perfect, it is for some takeoffs for lead quantities

  9. #9
    Senior Member RyanAtNelco's Avatar
    Computer Details
    RyanAtNelco's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Xenon
    RAM:
    6 gigs
    Graphics:
    ATI FirePro 2260
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    Burlington, MA
    Posts
    139

    Default

    oh i also have a bunch of line types i would like to do this for representing lead of different thicknesses, do you need the names of the line types?

  10. #10
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,709

    Default

    Registered forum members do not see this ad.

    Just made this as a quickie :

    Code:
    (defun c:ltlen (/ ldef lt ss len)
      (vl-load-com)
      (setq ldef (cdr (assoc 2 (tblnext "LTYPE" T))))
      (while
        (progn
          (setq lt
            (getstring t
              (strcat "\nSpecify Linetype <" ldef ">: ")))
          (cond ((eq "" lt) (setq lt ldef) nil) ; Exit Loop
                ((not (snvalid lt))
                 (princ "\n** Linetype Name Not Valid **"))
                ((not (tblsearch "LTYPE" lt))
                 (princ "\n** Linetype Not Found in Drawing **"))
                (t nil))))
      (if (setq ss (ssget "_X" (list (cons 0 "LINE") (cons 6 lt))))
        (progn
          (setq len
            (apply '+
              (mapcar
                (function
                  (lambda (x)
                    (vla-get-Length x)))
                (mapcar 'vlax-ename->vla-object
                  (mapcar 'cadr (ssnamex ss))))))
          (princ (strcat "\n<< Total Length of " (rtos (sslength ss) 2 0)
                         " Lines is: " (rtos len 2 2))))
        (princ (strcat "\n<< No Lines Found With Linetype " lt " >>")))
      (princ))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. Ohm's Law Calculator
    By The Buzzard in forum AutoLISP, Visual LISP & DCL
    Replies: 104
    Last Post: 20th Jul 2010, 12:05 pm
  2. AutoCAD Calculator
    By Lil-ndn-gyrl in forum AutoCAD General
    Replies: 2
    Last Post: 19th Mar 2009, 02:02 pm
  3. U - Value Calculator In Mep
    By S.P.I in forum MEP
    Replies: 0
    Last Post: 3rd Mar 2009, 05:04 pm
  4. Is there a ddedit CALCULATOR?
    By coombsie11 in forum AutoLISP, Visual LISP & DCL
    Replies: 15
    Last Post: 18th Oct 2008, 02:15 pm
  5. C - Calculator
    By CAD Panacea in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 11th Jan 2007, 05:24 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