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