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...*
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!
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...
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 =).
where in woburn? im near the mall on gill st
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...
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![]()
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...
excel would be perfect, it is for some takeoffs for lead quantities
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?
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
Bookmarks