LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Project hooks/trigger scripts by project state change, open/save/close

Dear LabVIEW community,

 

let me, please, ask you about the following - is it possible somehow to implement some functionality, which will be triggered by project load/save; kind of override some special hooks?

 

Let's say, my quick drop/or shortcut menu plugin will need to have list of some items in the project. But, I don't want to get it all the time dynamically, when quick drop is called. It could take time, and I don't want to wait, till quick drop or shortcut menu plugin will be initialized (there is nice shortcut menu plugin Add Bookmark.llb, which is difficult to use for large projects, b/c loading of bookmarks -> and shortcut menu appear time is long, which is confusing).

 

So it would be nice to get it (list of some items, etc.) when project is opened, or when it is saved - because when we open project, we know its initial state, and each change will be followed by save action; so we will could all the time get actual list of items (classes, bookmarks, comments - whatever).

Is it possible to reach by implementing custom project provider? Or, it is possible to override some project explorer hook (if any; b/c I didn't find info that something like this exists)?

 

Thank you very much in advance,

 

Sincerely, kosist90

0 Kudos
Message 1 of 5
(2,390 Views)

I don't know a direct way to do what you want, but you may be able to use the Application events as a starting point for triggering when user activity occurs in the project. 

0 Kudos
Message 2 of 5
(2,362 Views)

I'd start looking into the provider framework, although there's probably not enough public information about it to be useful. It would be a heavy solution...

0 Kudos
Message 3 of 5
(2,358 Views)

Thank you!

Seems, that maybe interface methods VIs (OnSaveProject, LoadComplete) (LabVIEW Project Provider.pdf, page 8, Chapter II, 6, https://forums.ni.com/t5/LabVIEW-Project-Providers/Project-Providers-Documentation/gpm-p/3492573) could be useful for it... But, I didn't work with project provider before, so I'm not sure whether this is right way to go...

0 Kudos
Message 4 of 5
(2,351 Views)

The provider framework is pretty neat, but it does require some commitment. It's not easy. Also it would not only be a lot of work for the development of one QD function, installation will also be much more complex. And it would require a LV restart, although that might be needed anyway. Usually way to much work, except for full fetched frameworks\addons. But it might be the only way to do it properly.

 

You could also consider a .NET file watcher on the project file. Not sure if that would work, you'll get an event after the save.

Message 5 of 5
(2,347 Views)