Jump to content

Calculate a total of lines length in LT


samifox

Recommended Posts

hi

 

sometimes im using Autocad LT, i want to be able to use some automation,

i need to calculate a total of selected lines and polylines.

 

can i do it with the automation tool LT has to offer?

 

Thanks

S

Link to comment
Share on other sites

It's not really an option to automate with just LT, but combined with excel you can get some good results, depending on how many lines you are talking about, for a few lines just start measuring and adding up, but when getting into a reasonable number to make this a headache, I would suggest making sure that you know what logfiles are (and enabled) and where on your system they are stored (if not thats your first thing to look up). This is the same information that is shown in your command history but is much easier to work with. The logfiles have the file extension .log but they are just a text file and changing the file extension from .log to .xls means you can open the file straight into excel. Now going through this in a bit more detail, you don't want to get flooded with useless information in your file so close the dwg you are working on and reopen it, this starts a fresh new logfile. Select all the lines and polylines you want to measure and use the list command, when that has run close the drawing again and go to the folder where the logfiles are stored and change the logfile extension to .xls (the logfile will have the same name as the drawing file with a few extra numbers added onto the end, or just sort the folder by date and it will be the first file in there.

When the excel file opens you should have a long list of information. I am going to presume you know how to use excel, if not it would be worth spending time to learn.

Use excel's option to split the text into columns (it's on the data tab about half way across) and use spaces and the "=" sign as separators for doing it. This will split up the list into colums of numbers and text. Select all the information and apply the excel filter.

Above the column that has the first usable data (probably column b) apply a text filter with the option to show lines that contain the text "length" and with the second option "or" select the lines that contain "perimeter" and apply the filter. If you have done Ok you should now have a list that in column C gives you all the lengths of lines, polylines (or perimeter of closed polylines). Select all the items in column C and on the bottom of the excel sheet you should have the total already added up for you, or just copy the numbers and paste it into a new sheet if you want to do anything else with it.

Sounds long and complicated but once you get used to doing this and know what sort of information you are looking for and can expect to get from Autocad then this literally only takes seconds. wether you have a dozen lines or thousands, and in combination with other information like layer names this can be a really powerful tool.

Link to comment
Share on other sites

Thanks you steven-g for your detailed post. this is for a friend of mine, as i know him he is not a comp-guy.

i think i will try to set a full ACAD for him so a lisp script can do this easily.

Thanks a lot,

S

Link to comment
Share on other sites

For Autocad "dataextract"

 

Steven-g nice idea about log file, I juts tried List pick multiple F2 copy the screen display to excel, as VBA is built in maybe just look through all cells in column A and find "Length" saving the VBA as a macro.

Link to comment
Share on other sites

I do it in VBA, and not just for line lengths, but that would be a lot longer to explain ;). the problem with F2 only really occurs when you are into large amounts of data, and it can run off the size of the screen dump. I like the log file and also use it to keep track of my work history for timesheets. And creating scripts as it has the command list.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...