06-23-2025 08:10 PM - edited 06-23-2025 08:15 PM
In a newly created project window (created at runtime, filled with top level VIs), the Dependencies folder is empty.
How to Refresh the folder programmatically? i.e. mimic select Refresh on the right click menu.
Solved! Go to Solution.
06-24-2025 07:23 AM
06-24-2025 07:42 AM
You can also just mass compile your code.
06-24-2025 09:32 AM
@aeastet wrote:
You can also just mass compile your code.
Seems a bit excessive if you only added a file to the project programmatically.
06-24-2025 10:17 AM
@raphschru wrote:
Hi zou,
Class TargetItem has a method "Refresh Dependencies":
Regards,
Raphaël.
Thanks everyone. Somehow I missed My Computer level.
Now I need to filter out NI VIs, such as DAQmx, niDMM, niScope, etc.
What is the best way?
IsSystemVI doesn't work.
06-24-2025 11:24 AM
@zou wrote:
@raphschru wrote:
Hi zou,
Class TargetItem has a method "Refresh Dependencies":
Regards,
Raphaël.
Thanks everyone. Somehow I missed My Computer level.
Now I need to filter out NI VIs, such as DAQmx, niDMM, niScope, etc.
What is the best way?
IsSystemVI doesn't work.
I would do it by path. Anything in vi.lib, or anything in instr.lib in a list of defined directories (or possibly just "instr.lib\ni*", if you feel confident that you won't be creating your own directories starting with "ni" in instr.lib.
Another potential option is if you use source control, you could only include files contained in source-controlled directories. Start with the current path, and keep going up until you find a ".git" or ".svn" in the folder or you reach the top level.
06-24-2025 11:26 AM
@zou wrote:
Now I need to filter out NI VIs, such as DAQmx, niDMM, niScope, etc.What is the best way?
IsSystemVI doesn't work.
Filter out NI VIs from what? Do you have an initial list?
If you have a list of:
- File paths ➡️ Check if each path is relative to vi.lib's path.
- Project item refnums ➡️ Check if property "Path" is relative to vi.lib's path.
- VI refnums ➡️ Check if property "VI Path" is relative to vi.lib's path.
You can also recursively read property "Owned Items[]" starting from your target's Dependencies item, then skip when you encounter the virtual folder "vi.lib".
Regards,
Raphaël.
06-24-2025 11:41 AM
@raphschru wrote:
@zou wrote:
Now I need to filter out NI VIs, such as DAQmx, niDMM, niScope, etc.What is the best way?
IsSystemVI doesn't work.
Filter out NI VIs from what? Do you have an initial list?
If you have a list of:
- File paths ➡️ Check if each path is relative to vi.lib's path.
- Project item refnums ➡️ Check if property "Path" is relative to vi.lib's path.
- VI refnums ➡️ Check if property "VI Path" is relative to vi.lib's path.
You can also recursively read property "Owned Items[]" starting from your target's Dependencies item, then skip when you encounter the virtual folder "vi.lib".
Regards,
Raphaël.
I use Get All Descendants to get a list of VIs under Dependencies.
Compare path is slow. Compare Two Paths.vi is not even Reentrant.
06-24-2025 11:53 AM - edited 06-24-2025 12:12 PM
06-24-2025 12:01 PM
OwnedItems[] plus file extension is better.