Discussion forum
?CAD discussions, advices, exchange of experience

Please abide by the rules of this forum.
|
Post Reply ![]() |
Page 12> |
Author | |
Vladimir Michl ![]() Moderator Group ![]() Arkance Systems CZ Joined: 26.Jul.2007 Location: Czech Republic Using: Autodesk software Status: Offline Points: 2124 |
![]() Posted: 28.May.2016 at 11:48 |
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner |
|
![]() |
|
jmontesmx ![]() Senior Member ![]() Joined: 28.Jan.2008 Location: Mexico Using: AutoCad2017 Status: Offline Points: 113 |
![]() |
;;; J.A. ;;; VER 1.0 - 2002-09-02 ;;; Begin Sumper.lsp - Application to calculate the length of selected objects (defun C:SUMPER (/ VADEC VALLPRC GLG SSLEN TPNAM (setq VADEC (getvar "cmdecho")) ;;; (defun MLEN () (princ "\n»» Select entities to calculate the length: \n") ; END Sumper.lsp |
|
![]() |
|
jmontesmx ![]() Senior Member ![]() Joined: 28.Jan.2008 Location: Mexico Using: AutoCad2017 Status: Offline Points: 113 |
![]() |
This can help you too, I ask the same thing some time ago
|
|
![]() |
|
Kent Cooper ![]() Senior Member ![]() Joined: 12.Mar.2013 Location: United States Using: AutoCAD2020, 2023 Status: Offline Points: 686 |
![]() |
(setq sset (ssget '((0 . "LINE,LWPOLYLINE"))) to this: (setq sset (ssget '((0 . "LINE,*POLYLINE,ARC,CIRCLE,ELLIPSE,SPLINE"))) BUT since not all of those entity types have the same "length" VLA property [some have one but under a different name], you would also have to change this line: (vla-get-length (vlax-ename->vla-object (ssname sset num))) to this: (vlax-curve-getDistAtParam (setq ent (ssname sset num)) (vlax-curve-getEndParam ent)) which will find the length of any (vlax-curve-...)-compatible entity, open or closed. And you can have it report in whatever Units you like. Change this: llen (rtos llen 4) which reports in Architectural units [the 4] to just: llen (rtos llen) if you want it to report in whatever your current Units and Precision settings are, or use other values for units and precision in the (rtos) function, to suit your requirements. [Also, I would change the (alert) to use a word like "object" instead of "line."]
Edited by Kent Cooper - 27.May.2016 at 16:52 |
|
![]() |
|
John Connor ![]() Senior Member ![]() Joined: 01.Feb.2011 Location: United States Using: AutoCAD 2018 Status: Offline Points: 7175 |
![]() |
You're welcomed. Glad to hear you found something that suits your needs.
|
|
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."
<<AutoCAD 2015>> |
|
![]() |
|
Ikenna ![]() Newbie ![]() Joined: 13.May.2016 Location: Nigeria Using: AutoCAD2013 Status: Offline Points: 6 |
![]() |
Sorry, I meant 'summation was given in metric units'. Yes, I got it in millimetres.
|
|
![]() |
|
Ikenna ![]() Newbie ![]() Joined: 13.May.2016 Location: Nigeria Using: AutoCAD2013 Status: Offline Points: 6 |
![]() |
John, thanks very much. I tried it and it worked perfectly. Everything was calculated - lines and arcs!, and the summation was given in metres!! Thanks again.
![]() |
|
![]() |
|
John Connor ![]() Senior Member ![]() Joined: 01.Feb.2011 Location: United States Using: AutoCAD 2018 Status: Offline Points: 7175 |
![]() |
You should have tried Lee Mac's program.
http://www.lee-mac.com/totallengthandarea.html |
|
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."
<<AutoCAD 2015>> |
|
![]() |
|
Ikenna ![]() Newbie ![]() Joined: 13.May.2016 Location: Nigeria Using: AutoCAD2013 Status: Offline Points: 6 |
![]() |
Thanks very much Kent. I just tried this method and it worked! But the issue is that it gives the summations in feet and inches. Secondly, it doesn't select arcs for summation.
|
|
![]() |
|
Ikenna ![]() Newbie ![]() Joined: 13.May.2016 Location: Nigeria Using: AutoCAD2013 Status: Offline Points: 6 |
![]() |
Thanks so much John. Let me check it out.
|
|
![]() |
Post Reply ![]() |
Page 12> |
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0,180 seconds.