Jump to content

Custom Selection of Instruments


Recommended Posts

Hi,

Here is my issue. I want to be able to write a script that will perform a custom selection of lighting instruments by circuit number. I am aware of the Find and Modify command in the spotlight menu but I find that cumbersome and want to have a custom selection by circuit number script in my commands menu. Apparently when a symbol is converted to a lighting instrument it no longer stores the data in a searchable record. I wanted to look at the Find and Modify script to see if I could pull out what I wanted but it is (of course) locked. Can someone please tell me the secret to selection of a lighting instrument?

Thanks in advance

Link to comment

quote:

Originally posted by E&S - Shaun:
Hi,

Here is my issue. I want to be able to write a script that will perform a custom selection of lighting instruments by circuit number. (of course) locked. Can someone please tell me the secret to selection of a lighting instrument?

Thanks in advance

Shaun, The VectorScript call ForEachObject allows you to specify a criteria and call a procedure to operate on all found items. You're looking for items with the "Lighting Device" record attached whose "Circuit Number" field has a particular value.i.e.

ForEachObject(<YourProcHere>, ((R IN 'Lighting Device') & ('Lighting Device'.'Circuit Number' = UserCircNum)));

I probably mismatched some parenthesis above but you should be able to get gist of whats going on. This tests to see if the Lighting Device record is attached and if so it checks to see if the circuit number field matches the value the user has entered previously.

HTH

Link to comment

quote:

Originally posted by kmoore1:

Shaun, The VectorScript call ForEachObject allows you to specify a criteria and call a procedure to operate on all found items. You're looking for items with the "Lighting Device" record attached whose "Circuit Number" field has a particular value.i.e.

ForEachObject(<YourProcHere>, ((R IN 'Lighting Device') & ('Lighting Device'.'Circuit Number' = UserCircNum)));

I probably mismatched some parenthesis above but you should be able to get gist of whats going on. This tests to see if the Lighting Device record is attached and if so it checks to see if the circuit number field matches the value the user has entered previously.

HTH

Works in theory. The Script does not work in the following configuration

PROCEDURE PickINST; PROCEDURE Pick(H : HANDLE); BEGIN SetSelect(H); END;BEGIN ForEachObject(Pick, ((T=PlugInObject) & (((R IN ['Lighting Device']) & ('Lighting Device'.'Circuit Number'=1)))));END;Run(PickINST);

However it does work when I remove the search critera for the Circuit Number. (Yes I do have instruments with a circuit number of one in my document)

This script selects all lighting instruments

PROCEDURE PickINST; PROCEDURE Pick(H : HANDLE); BEGIN SetSelect(H); END;BEGIN ForEachObject(Pick, ((T=PlugInObject) & (R IN ['Lighting Device'])));END;Run(PickINST);

What am I doing wrong? I have a feeling that the Lighting Device field information is stored differently than other Records (doesn't show up in the data tab of the object info. Where is it stored?)

Thanks in advance,

Shaun

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