The Hamma Posted August 22, 2012 Share Posted August 22, 2012 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); Quote Link to comment
WhoCanDo Posted August 28, 2012 Share Posted August 28, 2012 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 Quote Link to comment
Recommended Posts
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.