Jump to content
halfcouple

quickest addition of line lenghts

Recommended Posts

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.

 

Share this post


Link to post

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!

Share this post


Link to post

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]'))

  • Like 1

Share this post


Link to post

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.

Share this post


Link to post

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 ?

Share this post


Link to post

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);

 

  • Like 2

Share this post


Link to post

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
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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...