Jump to content
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

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.

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.

×
×
  • Create New...