Jump to content
Developer Wiki and Function Reference Links ×

Script to change a Record value?


Recommended Posts

Hello all,

Can anyone please point me in the direction of a command to set the record value of a PIO?

Specifically, in Spotlight: each Light (Device) has a checkbox for the "Draw Beam" option in the object info palette. Unfortunately, this check box is waaaay down in a long list of fields/records. So it it time consuming to toggle its state.

If I could write a script to change the "Draw Beam" record value to false or true, then I could make a tool which could be accessed via a simple right-click or other shortcut.

I am using VW12.5.0 on a MacIntel Powerbook.

Thanks,

Matt Zelkowitz

Available Light

Link to comment

Matt,

What you are trying to do can be achieved without any programming. By changing the order of the pio parameters, you can set the parameter at the top so that it may be viewed on the object info palette.

Otherwise, if you still want to script it, the following will toggle the value of selected pio's.

PROCEDURE TogglePar;

PROCEDURE ProcessObj(ObjHdl: HANDLE);

VAR

curState: STRING;

BEGIN

curState:= GetRField(ObjHdl,'Pio name','Draw Beam');

UprString(curState);

IF curState = 'TRUE' THEN

SetRField(ObjHdl,'Pio name','Draw Beam','False')

ELSE

SetRField(ObjHdl,'Pio name','Draw Beam','True');

END;

BEGIN

ForEachObject(ProcessObj,((SEL=TRUE)));

END;

Run(TogglePar);

The only thing you need to do is substitute 'Pio name' for the actual name of your pio.

Link to comment
  • 2 weeks later...

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