spaghetti_developer Posted October 28, 2013 Report Share Posted October 28, 2013 Hi guys,In order to get the selected controls of a FP, I thought to use the SelectList property of the panel of the FP. But, even though I have many controls selected before running the VI, the property doesn't return the references of the selected controls. It returns an empty array of references. If this property doesn't do what I was expected it have done, how can I get the selected controls of a FP before running the VI? Or How can I get the selected controls of a FP which is not running? Quote Link to comment
Yair Posted October 28, 2013 Report Share Posted October 28, 2013 Once a VI is reserved for execution (or running, which is the same thing practically) the selection list is always cleared - selections only exist in edit mode. To use the Selection List[] property, you have to open a reference to a VI which is in edit mode, which you can do by using either the Open VI Reference primitive or the New VI primitive, which will create a new VI. The property is very useful for performing operations on the selected items. Attached is the template I usually use if I want to write some quick code for manipulating multiple objects (LV 2009) - it get a reference to the VI you're working in. I believe it was a quick mod from something Norm posted. Scripting.vit Quote Link to comment
spaghetti_developer Posted October 28, 2013 Author Report Share Posted October 28, 2013 Ok... guys,I understood! The mistake was to try to get the selected controls from the FP of the VI where there was the code. It was enough to call the code as subvi from an external vi passing the reference of the vi where there were the selected controls using the "open vi reference" function. And the code started working! Thank you YAR for the advice! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.