Jump to content
Developer Wiki and Function Reference Links ×

Toggling field in OIP


rocitop

Recommended Posts

I have had some free time lately and I have started reading up on vectorscripts and have come across a project where it might be useful to make one. What the script needs to do is select a group of spotlight instruments (this much I have) and then change the 'Draw Beam' field from check to unchecked or vise versa. I think that because the Draw Beam field is yes or no it will require a SetObjectVariableBoolean command. but I don't have a grasp on the handle parameter, the definition is given as

SetObjectVariableBoolean(h :HANDLE; index :INTEGER; status :BOOLEAN);

but in the example it is

SetObjectVariableBoolean(17,FALSE);

Where did the handle go?

Any tips or pointers?

Link to comment

rocitop,

Close, but no cigar;-)

It is not an ObjectVariable. The light is a Plug-In Object (PIO). That means that there are a number of parameters (variables) that can be set through the Object Info Palette (OIP). The parameters are stored in a Record.

In order to change the parameters, you neet to use SetRField to set them (or GetRField to read them).

For a light object, you need to use SetRField(OH,'Lighting Device','Draw Beam', 'T');

OH is a handle to the object. 'Lighting Device' is the name of the record (usually the same as the name of the PIO, but not if it has been localized). 'Draw Beam' is the name of the field (again watch out for localization.) Finally, SetRField always take a string as the final parameter. Since Draw Beam is a boolean, you must use 'T' to turn it on or 'F' to turn it off.

To check for the record and field names to use, lookup the parameters of the object in the VectorScript Plug-In Editor.

Check out the VectorScript Guide on Plug-Ins and Fields and Records for more information.

Pat

Link to comment

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