LAVA 1.0 Content Posted March 20, 2009 Report Share Posted March 20, 2009 I'm trying to find out if a given library is part of another libary. I don't get anything sane to work. For a VI there is a 'Library' property that returns the owning library reference. For a library such feature does not exist. Even stranger is that the 'Localized Name' or 'Display Name' only contain the bare name of the library. I currently have one workaround: And this solution needs any VI to be inside the lvlib root-folder. Ton PS this code needs to be done in 8.2 so any ideas? Edit: Darren Twittered QUOTE @tonplomp If you have the library's ProjectItem, you can get Parent in a loop until you hit a target or a library. So I builded the following project setup: The 'Untitled 4.vi' has the following contents: Note that the Parent's ref of the folder is not valid! Somehow the folder inside the top-level library has no valid parent Ton Quote Link to comment
LAVA 1.0 Content Posted March 23, 2009 Author Report Share Posted March 23, 2009 I found a working implementation: Ton Quote Link to comment
Aristos Queue Posted March 23, 2009 Report Share Posted March 23, 2009 QUOTE (Ton @ Mar 22 2009, 12:31 PM) I found a working implementation: You should be aware that the solution you have hit upon won't detect all types of libraries. There are (currently) five library types: .lvlib, .lvsc, .xctl, .lvclass and the mythical one that some LAVA users believe in. Of these, all but .lvclass can have libraries inside of it (a limitation that would be nice to remove but is not scheduled to be worked on any time soon). You probably want to make this work for all the types, not just .lvlib, which is what testing for "Library" as a type string does, including any future types that LV may introduce. Do I have any idea how to do that? No. For the record, I am not a fan of any of the ProjectItem API, but here's something that might help you in this particular quest: http://lavag.org/old_files/monthly_03_2009/post-5877-1237749800.png' target="_blank"> I have no idea why there is no "Open By Name" method. 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.