06-30-2010 01:07 PM
I'm looking for a way to get a front panel item's refnum from a local variable or wire. Is this possible?
Is there a way to accomplish the following? (These are edited images, you cannot currently do this in LV)
or perhaps
If this kind of thing is not possible, is there a reason for it? If there's no reason why this can't be done, I'll go put this on the suggestion boards.
Solved! Go to Solution.
06-30-2010 01:34 PM
Why do you need this?
A wire is simply data. It is not associated with a control.
Similarly, a local variable is a way to access a control's data, not to interact with the control itself.
Is right clicking the control and selecting Create>>Reference not good enough for you?
You can write code to get the reference of controls connected to the wire and of the the control whose local variable you want, but I get the feeling this isn't actually what you want.
06-30-2010 01:36 PM
The wire contains a value, ie. just a number. So you can't really get a reference from the value. The reverse is possible, you can easily get the value given the reference.
I am not sure what you are trying to do, but you should probably be thinking in terms of passing references around and occasionally getting the value instead of passing values around and trying to get the reference.
Numerous caveats follow, overuse of property nodes can slow things down and make your BD grow quite large. Same for locals.
It is a matter of personal opinion as to when the complexity is worth it. My sense is that if we knew what you were trying to do, we could suggest alternate ways of getting it done.
06-30-2010 01:49 PM
I'm taking someone else's code and updating it, merging it with code I've written. I use references, he didn't. Having the option of wiring anything into a property node would greatly reduce the time required to rewrite his code. That's really all I was looking for.
And yes, Right Click -> Create Reference (or linking property nodes) is what I've been using.
Thanks guys