Jump to content

Copy point to point script


The Hamma

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

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