blawson Posted August 17, 2010 Report Share Posted August 17, 2010 Hi all, I just wrote a little window management script for use while developing. I get a reference to all of the VIs belonging to a target application instance that have an open & visible BD or FP. My initial approach was to get a VI.OwnedApp reference and then get App.AllVIs. I autoindex that in a for loop and get VI refs by name for each element. Then I check each VI's properties to filter it. This worked swimmingly... and then l I opened a big project with >1k loaded VIs, where it takes several seconds to execute. Is there a property or method anywhere that will give me a more focused list of names or references? Do I have to filter the list myself? LV2009sp1, Win7 Quote Link to comment
blawson Posted August 17, 2010 Author Report Share Posted August 17, 2010 too late to edit... turns out that the problem I was having is that BD.open is incredibly slow. If I only check BD.open when FP.open is true, everything's nice and fast. Quote Link to comment
Mellroth Posted August 17, 2010 Report Share Posted August 17, 2010 ...Is there a property or method anywhere that will give me a more focused list of names or references? Do I have to filter the list myself? Can you tell us more what you want to do with the references? The reason I ask is that there are other ways of getting the BD or FP reference while editing, e.g. if you just want to handle the top most window you can do this with event filtering. Monitor the private event type "VI activation", and from this you'll get the VI reference as well as a numeric telling you whether the BD or FP was activated. See attached VI MonitorActiveVI.vi /J Quote Link to comment
blawson Posted August 17, 2010 Author Report Share Posted August 17, 2010 Can you tell us more what you want to do with the references? /J For now I'm just tweaking window position and size for when I hop around between machines with different display sizes. Ultimately i'd like to save/restore the state of the open windows of a project. The former works pretty well one window at a time, but in order to do the latter, I really need the whole list. Once I benchmarked the individual properties, it was clear that the BD window props are slow, roughly in proportion to the size in memory of the diagram. 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.