Total Length in MacOS [AutoCAD for MAC]

MPB007
Observer
Observer

Total Length in MacOS [AutoCAD for MAC]

MPB007
Observer
Observer

Hi, ive got autocad on macOS, ive got a lisp file to select all the lines to give me the total measurements in millimetres, but this wont work on macOS, is there a compatible file that i can use to do this because the measurgeom option on autocad takes to long to do all designs by just selecting them

 

 

 

The topic title has been edited to improve findability by @alina.balkanskaia. Original: Total Length in MacOS

0 Likes
Reply
Accepted solutions (2)
7,207 Views
23 Replies
Replies (23)

maxim_k
Consultant
Consultant
Accepted solution

Welcome to Autodesk Forums!

 

Hi Marius,

 

Try attached tlen.lsp which:

"Calculates and reports the total length of a selection set of line, polyline, arc, circle, ellipse, and other objects in drawing."

It works fine on my Mac.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community

Anonymous
Not applicable

Hello, please can you mention in which folder should we Paste the tlen.lsp file?

0 Likes

maxim_k
Consultant
Consultant
Welcome to Autodesk Forums!

Hi Charles,

You can place LSP file to any folder inside your Home folder.
I'd recommend you to create special folder for such cases and add it to TRUSTEDPATH system variable:
https://knowledge.autodesk.com/support/autocad-for-mac/learn-explore/caas/CloudHelp/cloudhelp/2017/E...

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes

Anonymous
Not applicable

Hello Maxim,

 

Please help me.

I have pasted the tlen.lsp in the ApplicationAddins folder of ACADLT 2019 but the command tlen is does not working.

I have to measure a total lenght of 2021 pipelines and I am desperate!

May you help me please to understand how to do this?

 

 

Many thanks in advance

Andrei Vrublevschi

Beginner in ACAD business

0 Likes

maxim_k
Consultant
Consultant
Accepted solution
Welcome to Autodesk Forums!

Hi Andrei,

Sorry, but AutoCAD LT doesn't support AutoLISP (that is one of the reasons it is cheaper than full AutoCAD).

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community

Anonymous
Not applicable

Hi Maxim,

 

Thank you very much for your quick reply.

So, to be clear for me, have I  any chance to calculate a total lenght with ACAD LT ?

 

Regards,

Andrei

0 Likes

maxim_k
Consultant
Consultant

Well, also AutoCAD LT "LT is the wrong software for what you need to do", if you have Excel on your Mac, you can try the solution from this thread:

https://forums.autodesk.com/t5/autocad-lt-forum/how-to-measure-total-length/td-p/6317587

To be more precisely, you need Total length.xls spreadsheet from this post:

https://forums.autodesk.com/t5/autocad-lt-forum/how-to-measure-total-length/m-p/7160235#M155052

 

You also need to make some preparations in AutoCAD LT - enable LOG file for the time you will collect data for calculations - results of LIST command. So at first you need to verify (or change) the location of AutoCAD LOG file in AutoCAD preferences -> Application tab ->Log file location:2019-04-08_16-37-02.png

Then you need to turn on LOG file creation with LOGFILEON command.

From now all Command prompt output will be written to XXX.log file (XXX - the name of current drawing) in the folder you set for Log File Location.

Now you need to set undocumented system variable QAFLAGS=2 - this will allow not to use LIST command without any interaction, until it complete its job.

 

Now - use QSELECT command to select polylines (or other types of objects you want to calculate total length) in your drawing. After you select all polylines you need (they should be selected) - use LIST command to collect information about them.

If you don't need calculate length anymore, turn off LOG file creation (other way Log File Location folder will be blowed with unnecessary .log files)

Open "XXX.log" file created for your drawing in plain text editor (Textedit app), you will see something like this:

Command: LOGFILEON

Command: QSELECT

Select objects: Specify opposite corner: 4645 found

Select objects:  
4157 item(s) selected.

Command: LI
LIST 4157 found

                  LWPOLYLINE  Layer: "AXIS"
                            Space: Model space
                   Handle = 15d968
              Open 
    Constant width    0.0000
              area   0.0000
            length   2518.8764 

          at point  X=204049.8573  Y=73259.8524  Z=   0.0000
          at point  X=204049.8573  Y=70740.9761  Z=   0.0000

                  LWPOLYLINE  Layer: "AXIS"
                            Space: Model space
                   Handle = 15d964
              Open 
    Constant width    0.0000
              area   0.0000
            length   2518.8764 

          at point  X=197483.6713  Y=73259.8524  Z=   0.0000
          at point  X=197483.6713  Y=70740.9761  Z=   0.0000
.......
                 LWPOLYLINE  Layer: "WIN"
                            Space: Model space
                   Handle = 15c73c
            Closed 
    Constant width    0.0000
              area   146763.8186
         perimeter   1606.5530 

          at point  X=201932.3048  Y=76774.7109  Z=   0.0000
          at point  X=202150.3897  Y=76390.8032  Z=   0.0000
          at point  X=202484.3305  Y=76394.3305  Z=   0.0000
          at point  X=202358.4077  Y=76779.1939  Z=   0.0000

                  LWPOLYLINE  Layer: "WIN"
                            Space: Model space
                   Handle = 15c73b
              Open 
    Constant width    0.0000
              area   0.0000
            length   415.1461 

          at point  X=190108.7357  Y=76711.6982  Z=   0.0000
          at point  X=190206.1890  Y=76308.1525  Z=   0.0000

Command: 

Now select everything from the beginning of LIST command to its end and copy to clipboard.

If you don't need calculate length anymore, turn off LOG file creation (other way Log File Location folder will be blowed with unnecessary .log files)

Open Total length.xls in Excel and allow macros in it.

Use  the button labelled 'paste & calculate'. The object properties text will be pasted into column A and the formula in column B will analyse the text & extract the relevant length data. The total length will then be displayed in the green result box in your chosen format. (full description of how it works in spreadsheet - see in the post I linked above)

 

That is all.

 

Once again - don't forget to switch off creation of LOG file + set QAFLAGS=0 (default value) after you will make all calculations.

 

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community

Anonymous
Not applicable
Hi Maxim, Many many thanks! Good day, Andrei
0 Likes

maxim_k
Consultant
Consultant
Hi Andrei,
Have you tried the trick with Excel? Does it work for you?

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes

Anonymous
Not applicable

Добрый день. 

Спасибо за вашу работу!

Есть проблемка с  Tlen.lsp

Я загрузил его через команду appload, он вроде успешно загрузился, но не работает.

0 Likes

maxim_k
Consultant
Consultant
Добро пожаловать на Форум!

Здравствуйте, Антон!

Что Вы видите в командной строке, когда пытаетесь выполнить команду?
Не работает во всех файлах чертежей? Даже во вновь созданных, с небольшим количеством объектов?
Если только в определенных - прикрепите пример DWG файла где Лисп не работает, я попробую разобраться в чем дело.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes

Anonymous
Not applicable

Добрый день, Максим.

В командной строке прописано, что файл успешно загружен.

Пробовал на разных файлах, не работает.

При вводе команды applad, в всплывающем окне лисп прописан но не активен (скинул скрин)

Я все делал, как для автокада под виндоус. Тоже кастати ваш лисп загружал - все работало

Спасибо!

0 Likes

maxim_k
Consultant
Consultant

У меня все работает с Вашим файлом:

 

tlen.gif

 

Вы точно загружаете необходимый LSP?

 

>>>>При вводе команды applad, в всплывающем окне лисп прописан но не активен

На вкладке "Loaded applications" он и должен быть неактивным, поскольку эта вкладка предназначена для выгрузки (unload) приложений из памяти, а приложения AutoLISP выгрузить командой нельзя - они выгружаются автоматически при закрытии файла, в котором были загружены (если только они не прописаны в Startup Suite)


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes

Anonymous
Not applicable

спасибо!! все работает. Это я лошарик)

0 Likes

djunira2014
Community Visitor
Community Visitor

should we load the plugin every time we want to use it? or we load it once?thanks

0 Likes

maxim_k
Consultant
Consultant

Welcome to Autodesk Forums!

 

Hi @djunira2014 

 

Yes, you need to load it every time, but you can ad it to Startup Suite in APPLOAD window and it will be loaded automatically:

2021-01-25_14-34-55.png

 

http://help.autodesk.com/view/ACDMAC/2021/ENU/?guid=GUID-B38F610B-51FB-4938-BDEC-A0A737F5DB6C

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes

djunira2014
Community Visitor
Community Visitor
Thanks.
0 Likes

cmeddock
Participant
Participant

@AnonymousI'm 4 years late, but was looking at this thread trying to solve a similar issue. I also have LT, plus I'm a novice at computer science, so the solution will take too much brain power for me. However, I have a painstaking work around for others who come across this thread; it may be helpful. Can you connect all the segments of your pipeline into 1 single polyline? Then select the polyline and see the total length in the properties window?

0 Likes

ruirego
Enthusiast
Enthusiast

hello,

im also novice here trying to improve my productivity with the few knowledge that i have. 

for that exemple, if you have plines instead of lines you can automatically sum all (even if not connected)

 

hope it helps

r^2

0 Likes