Jump to content

Fixing Polylines


Recommended Posts

Here are three scripts that can be used to fix problems with polylines.

One closes open polylines

One deletes the last drawn segment of a polyline. For those times that you don't manage to double click and get an extra segment drawn.

One deletes the last segment and closes the polyline.

If you don't know how to use these see Robert Anderson's post on Vectorscript in this forum.

As always, you are free to use these in any fashion you want. If you do so, please give me credit.

Use at your own risk. Do not operate heavy equipment while using these scripts. Abandon hope all who enter here. Poly want a cracker.

Procedure ClosePolylines;
{This script will close an open polyline by setting every edge to be shown}

{? 2009, Coviana, Inc - Pat Stanford pat@coviana.com}
{Licensed unde the GNU Lesser General Public License}

Var
H1			:Handle;
N1,N2	:Integer;

Begin
H1:=FSActLayer;
N1:=GetVertNum(H1);
For N2:=0 to N1 do
	Begin
		SetVertexVisibility(H1,N2,True);
	End;
ResetBBox(H1);
End;

Run(ClosePolyLines);

Procedure FixExtraPolyClick;

{This script deletes the last click of a polyline}
{Useful when you accidentally don't click at exactly the }
{beginning point and have a very short last segment}
{May be run multiple times if it takes several clicks to }
{hit the start point and make a closed polyline}

{? 2009, Coviana, Inc - Pat Stanford pat@coviana.com}
{Licensed unde the GNU Lesser General Public License}


Var
H1			:Handle;
N1,N2	:Integer;

Begin
H1:=FSActLayer;
N1:=GetVertNum(H1);
DelVertex(H1,N1);
SetVertexVisibility(H1,N1-1,True);
ResetBBox(H1);
End;

Run(FixExtraPolyClick);

Procedure FixExtraPolyClick;

{This script deletes the last click of a polyline}
{and closes the open edge. Useful when you accidentally}
{don't click at exactly the beginning point, but double }
{click to end the polyline entry}
{? 2009, Coviana, Inc - Pat Stanford pat@coviana.com}
{Licensed unde the GNU Lesser General Public License}


Var
H1			:Handle;
N1,N2	:Integer;
B1			:Boolean;

Begin
H1:=FSActLayer;
N1:=GetVertNum(H1);
B1:=GetVertexVisibility(H1,N1-1);
DelVertex(H1,N1);
SetVertexVisibility(H1,N1-2,B1);
ResetBBox(H1);
End;

Run(FixExtraPolyClick);

Link to comment

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.

×
×
  • Create New...