Jump to content

Scripting to change class


benpilat

Recommended Posts

I'm trying to make a "smart" circuit plot, where circuit numbers appear/disappear/change colors based on there being a null/non-null dimmer field in a light. The goal is to make it as automatic as possible, so when a dimmer number is used, it's corresponding circuit changes color.

It seems to me that changing classes is the way to go. Is there a way to script that? Do the circuit numbers themselves need to be lighting instruments?

I don't have much advanced scripting experience, but I'd love to hear thoughts if anyone can point me in the right direction.

Thanks!

Link to comment

It is unclear how your drawing is organized. Do you want circuit numbers in label legends to change color? If the circuit on the plot is not part of a label legend and a light had a null value for dimmer how would a non-label legend circuit object know to change color. Unfortunately/Fortunately, the color of a circuit number in a label legend (LL) is governed by the definition of the label legend, so the only way to change the color of a circuit in an LL is in the LL's definition. Doing so would change the color of the circuit in all instances of that LL regardless of the light it was attached to. If you're not talking about label legends, we would need to know more about how your circuit number is placed on the plot and what its relationship to a light and to a dimmer is.

Sam

Link to comment

Sam,

No, the circuit number/dimmer field in the label legend should not change color. The circuit (as drawn in a representation of its physical location in a raceway) should be a separate object, with a circuit number assigned to it. This object will be in the class "unused circuits". When that circuit number appears in the dimmer field of a lighting instrument, I want the circuit number object to automatically change classes to the class "used circuits". I'll use class colors to handle the color change, so the automatic class change is really what I'm after.

It seems that it may be easiest to make the circuit numbers "instruments" as well. You're right to bring up the question of how the circuit number is associated with a light/dimmer. Maybe a "find and modify" script is run that looks for each dimmer field value. When two lights are found (meaning that one dimmer is the circuit and one dimmer is the actual light), as opposed to one light being found, it changes the class. However, that solution would change the class of the light as well as the circuit object.

But hopefully the goal is clearer now. I'd like there to be circuit numbers drawn on a circuit plot in their physical placement in the theatre. When I plot a light that uses that circuit number, I'd like to be able to run a script that changes the class/color of the circuit object, giving me a way of automatically tracking the location of unused circuits.

Here is a reply to my question posted in the scripting forum, if it's of any use... I'm not sure it addresses the real question.

"This is the idea behind plugin objects where the graphics will change based on the user preferences or choices. You can add a popup parameter/field with the two choices and the script will change the look of the circuit based on the selection. At the same time you can also update the id numbers assigned to the circuits."

Link to comment

Ben,

What you describe could be achieved by placing symbols of circuits that have a record attached. The record would have a field that held the value of the circuit number and maybe a yes/no field as to whether the circuit is used. Then a menu command would be run that cycles through each light reads the assigned circuit and then changes the class of all the circuit symbols that have that value in their circuit field (probably only one object). The method for doing this can probably best be done using an array. This is not trivial, but it is not rocket science. An interesting system to create, but I who else needs to do this? AutoPlot Tools for SpotLight has a "List Unused Circuits" command that uses a similar approach, but all it does is make a list it doesn't change any graphic objects.

HTH,

Sam

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