Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
The Hamma

Copy point to point script

Recommended Posts

Below is a script by Peter Vandewalle and it work fine as a command or from the script palette but if I run it as a tool the angle constraints don't kick in to the second object duplication. Does any one know why and how to fix it. I like this script vs the move by point tool because it makes a duplicate object at every point that I click. and I don't have to keep switching the move by point from retain objects to not retaining objects.

Procedure CopyPt;

{Peter Vandewalle, 14-03-2003}

LABEL 99;

VAR

ObjHdle,NewHandle:HANDLE;

xi,yi,xm,ym,xp,yp,X,Y:REAL;

YesNo:BOOLEAN;

SelNum:LONGINT;

Procedure do_error(s:STRING;v:REAL);

BEGIN

AlrtDialog(Concat(S,' = ',Num2Str(5,V)));

END;

BEGIN

Absolute;

SelNum:=NumSObj(ActLayer);

IF (SelNum=0) THEN BEGIN

Message('Select object to copy:');

GetPt(X,Y);

SetSelect(PickObject(X,Y));

END;

Message('Click reference point');

GetPt(xi,yi);

YesNo:=false;

xp:=xi;

yp:=yi;

REPEAT

Message('Click endpoint, double-click to exit');

GetPtl(xi,yi,xm,ym);

IF ((xp=xm) AND (yp=ym)) THEN GOTO 99;{Check 4 double-click}

Duplicate(xm-xp,ym-yp);

xp:=xm;

yp:=ym;

UNTIL YesNo;

99:ClrMessage;

DSelectAll;

RedrawAll;

ClrMessage;

END;

Run(CopyPt);

Share this post


Link to post

I have just copied and pasted this into a VS palette and the macro works fine.

I have also copied and pasted it into a new VS Plug-in type Tool which also works for me.

Can't offer a reason why it doesn't work for you though.

Regards

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

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.

×