Pat Stanford Posted February 19, 2015 Share Posted February 19, 2015 This is an example script that shows how to use the ForEachObject call to find certain Lighting Devices and rotate, move and change field values. Please use as you see fit. Procedure SetLightParams; {An example script showing how to rotate, move and set field values of a lighting object} {February 19, 2015} {© 2015, Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} Var ThisLight: Handle; Procedure ActOn(ThisObject:Handle); {ThisObject is a handle to the object passes by ForEachObject} Var X1,Y1,R1 : Real; Begin {Set the Symbol Name field to desired value} SetRField(ThisObject,'Lighting Device','Symbol Name','Conventional'); {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); {Move to a Y value of zero by moving by negative of current Y value} HMove(ThisObject,0,-Y1); End; Begin ForEachObject(ActOn,(((PON='Lighting Device') & ('Lighting Device'.'Device Type'='Light')))); {ForEachObject will run the procedure named ActON one for each Lighting Device of type Light} End; Run(SetLightParams); 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.