Dexie Posted April 22, 2008 Share Posted April 22, 2008 Does anyone have a script which will match the angle of rotation of a number of different symbols to one selected symbol. Quote Link to comment
islandmon Posted April 22, 2008 Share Posted April 22, 2008 DSelectAll; SelectObj((T=SYMBOL)); Quote Link to comment
Dexie Posted April 22, 2008 Author Share Posted April 22, 2008 I was hoping to be able to select a number of symbols. Run a script which would prompt me to select another target symbol and all the symbols would rotate to the same orientation of that target symbol. I would like to use it to place a house symbol on a street then place other houses on the same street and the quickly rotate them to the same angle. Quote Link to comment
Ray Libby Posted April 22, 2008 Share Posted April 22, 2008 http://www.vectordepot.com/PlugIns1.shtml Scroll down to Rotate About Center. Figure out the rotation angle, select all the houses and rotate. Quote Link to comment
Pat Stanford Posted April 22, 2008 Share Posted April 22, 2008 Check out this thread. It has a script to rotate object around their centers. You have to manually enter the amount of rotation, but the script could be edited to do what you want. http://techboard.vectorworks.net/ubbthreads/ubbthreads.php?ubb=showthreaded&Board=25&Number=94845&Searchpage=1&Main=20191&Words=rotate+Pat+Stanford&topic=0&Search=true#Post94845 Pat Quote Link to comment
CharlesD Posted April 6, 2015 Share Posted April 6, 2015 I am having the same problem here as the OP was. Pat's script example is fantastic and is almost 100% of what I'm looking for. Just trying to replace that dialog with the ability to select a target object (symbol, truss, lighting device, line) and obtain the rotation angle from that. I think this might be in the right direction: GetCustomObjectInfo(name,handle,record,wall); GetSymRot(handle); As I've very new to VS I'm wondering if anyone might have any example scripts of scripts that have a target selection action as part of them. Hoping I can then reverse engineer that bit and plug it in instead of Pat's dialog. Quote Link to comment
CharlesD Posted April 6, 2015 Share Posted April 6, 2015 Figured it out! A big thanks to Pat Stanford whose scripts provided the basis for my franken-script. This was the first time I've really coded much with variables in a decade. Fun stuff! Procedure SetLightParams; Var ThisLight,PickTarget: Handle; R2,X2,Y2,Z2 :Real; FUNCTION CheckObjCallback(h : HANDLE) : BOOLEAN; {or FUNCTION CheckObjCallback(h : HANDLE; px, py : REAL) : BOOLEAN;} {or FUNCTION CheckObjCallback(h : HANDLE; px, py, pz : REAL) : BOOLEAN;} BEGIN {any object is ok} CheckObjCallback := TRUE; END; Procedure ActOn(ThisObject:Handle); {ThisObject is a handle to the object passes by ForEachObject} Var X1,Y1,R1 : Real; Begin {Get the current rotation of the object. GetSymRot works on PIOs as well as symbols} R1:=GetSymRot(ThisObject); {Get the current location of the object. GetSymLoc also works with PIOs as well as symbols} GetSymLoc(ThisObject,X1,Y1); {Set Rotation to Zero by rotating the negative of the current value} HRotate(ThisObject,X1,Y1,-R1+R2); End; Begin TrackObject( CheckObjCallback, PickTarget, x2, y2, z2 ); IF PickTarget <> NIL THEN BEGIN ForEachObject(ActOn,((SEL=TRUE))); {ForEachObject will run the procedure named ActON one for each Lighting Device of type Light} End; End; Run(SetLightParams); Quote Link to comment
RickR Posted April 15, 2015 Share Posted April 15, 2015 I just copy and paste the rotation value. That requires reverse operation: Select correct symbol and copy rotation; Select others and paste. Since you can paste multiple times you don't have to get your selection set perfect. 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.