Jump to content

Does the SelectList propery of a panel work?


Go to solution Solved by Yair,

Recommended Posts

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?

Link to post
Share on other sites
  • Solution

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

Link to post
Share on other sites

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!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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

Important Information

By using this site, you agree to our Terms of Use.