halfcoupler Posted May 22, 2020 Share Posted May 22, 2020 Hi @all anyone here knows the ultimate trick? I have several lines selected somewhere on the drawing. I want to summarize their line length. Except adding the OIP Values manually or create a worksheet, what is the quickest way to get this value ? Workflow should be something like: - Select the lines - do something => get result. - choose other lines - repeat. Quote Link to comment
Rossford Posted May 22, 2020 Share Posted May 22, 2020 I asked this question a few weeks ago. No answer, and I haven't found a way to do it. On things like our drainage plans, which could be lines from point to point, we just remember to add a third point, even if on a straight line, and draw them as polygons. It is also possible to compose 2 (or more) intersecting lines after drawing them and it converts them to a polygon where the perimeter is the length. If you have multiple combined lines they will all compose/connect only to themselves, and it will show as 4 (or whatever) polygons with a total measurement, if all are selected. While a bit time consuming, if you did it often, a simple script and shortcut key to run it would speed it up. Best I got! I hope others have better! Quote Link to comment
P Retondo Posted May 23, 2020 Share Posted May 23, 2020 You can create a worksheet function. Assign a class to the lines you want to total, and create a worksheet cell with the following definition: =LENGTH((C='[classname]')) 1 Quote Link to comment
Rossford Posted May 24, 2020 Share Posted May 24, 2020 Agree on the worksheet function, but am I the only one who likes to set classes to show or gray others, hit select all just to take a quick look that some drain pipe class (say 6" or whatever) just looks like they are all right? Old school yes, but I never quite trust all the automation. But, yes, eventually getting them into a bid form this works great. Quote Link to comment
halfcoupler Posted May 25, 2020 Author Share Posted May 25, 2020 Yes, as requested, worksheet is one solution, but it is not quick enough. I'm looking for something that I can use while drawing. Background: Basically it is a kind of tent construction that has to fit to an existing canvas. I am searching for best design of lines, arcs, polygons and nurbs that match a certain perim lenght. It is a trial and error process in which I have to run through, since there will be several shape-designs that fit. But I guess a function like this could be helpful for the Landmarkers too... Maybe that is a Marionette task ? Quote Link to comment
Pat Stanford Posted May 25, 2020 Share Posted May 25, 2020 Try this script. It sums the length of all of the Visible Selected Lines, Arc, Open Polygons and Open Polylines. The value is returned in a string dialog box so you can copy the value if you need to paste it somewhere. If you don't need that functionality, the final output could be provided in a different, less obtrusive fashion like a message box or even an minor alert so it only shown in the bottom border of the drawing window. You can just create a new blank Vectorscript document and paste everything below into the script editor and then run by double clicking on the script name in a script palette. Or you can make a Plug-in Command using the Plug-in Manager (Tools menu) and add it to your workspace and give it a keyboard shortcut. Procedure SumOfSelectedLengths; {May 25, 2020} {©2020 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {Displays a dialog box showing the summed length of all} {selected and visible lines, arcs, open polygons and } {open polylines.} {No Warranty Expressed or Implied. Use at your own risk.} {Stop use and ask a doctor is nausea lasts more than 2 weeks} {In case of overdose contact poison control center right away} {Do not operate electic scooters while using this script.} Var TheSum:Real; S1:String; Procedure AddEm(H1:Handle); Var TheType:Integer; Begin TheType:=GetTypeN(H1); Case TheType of 2: Begin TheSum:=TheSum + HLength(H1); End; 5: Begin If Not(IsPolyClosed(H1)) Then TheSum := TheSum + HPerimN(H1); End; 6: Begin TheSum:=TheSum + HPerimN(H1); End; 8: Begin If Not(IsPolyClosed(H1)) Then TheSum := TheSum + HPerimN(H1); End; 21: Begin If Not(IsPolyClosed(H1)) Then TheSum := TheSum + HPerimN(H1); End; End; End; Begin TheSum:=0; ForEachObject(AddEm, ((((T=LINE)|(T=POLY)|(ST=OPENEDARC)|(T=POLYLINE)) & (VSEL=TRUE)))); S1:=StrDialog('The Sum of the Lengths of the Selected Objects is:', Num2StrF(TheSum)); End; Run(SumOfSelectedLengths); 2 Quote Link to comment
halfcoupler Posted May 26, 2020 Author Share Posted May 26, 2020 Thank You Pat, this is exactly what I need ! ! 😀😀😀 Quote Link to comment
Rossford Posted May 26, 2020 Share Posted May 26, 2020 Thanks, Pat. Will tee this one up later today! Quote Link to comment
Recommended Posts
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.