|
| MAS ETH ARCH/CAAD - 2005/06 - STUDENT PAGES Master of Advanced Studies in Architecture, Specialization in Computer Aided Architectural Design | 065-0005/6 Supervision: Prof. Dr. Ludger Hovestadt, Philipp Schaerer Chair of CAAD, ETH Zurich Toni Kotnik Module 1: Scripting|Mini-Assignment 2 development of a plugin for Vectorworks to move selected objects Select plugin and define translation vector ... Move: move selected objects PROCEDURE script1; (* move selected objects *) VAR x1,y1 : REAL; (* coordinates of first mouse click *) x2,y2 : REAL; (* coordinates of second mouse click *) dx,dy : REAL; (* distance to move *) BEGIN GetLine(x1,y1,x2,y2); dx:=x2-x1; dy:=y2-y1; MoveObjs(dx,dy,TRUE,FALSE); END; RUN(script1); Copy: move a copy of selected objects PROCEDURE script2; (* copy selected objects *) VAR x1,y1 : REAL; (* coordinates of first mouse click *) x2,y2 : REAL; (* coordinates of second mouse click *) dx,dy : REAL; (* distance to move *) BEGIN GetLine(x1,y1,x2,y2); dx:=x2-x1; dy:=y2-y1; Duplicate(dx,dy); END; RUN(script2); Repeated Copies: move a copy of selected objects several times PROCEDURE script3; (* repeated copy of selected objects *) VAR x1,y1 : REAL; (* coordinates of first mouse click *) x2,y2 : REAL; (* coordinates of second mouse click *) dx,dy : REAL; (* distance to move *) n : INTEGER; (* number of copies *) i : INTEGER; (* counter *) BEGIN n:=IntDialog('number of copies','1'); GetLine(x1,y1,x2,y2); dx:=x2-x1; dy:=y2-y1; FOR i:=1 TO n DO Duplicate(dx,dy); END; RUN(script3);
|
This website has been archived and is no longer maintained.