I know how to use scripting to traverse the Tag Tree Browser and collect information, but is there a way to traverse the Project Tree Browser (given a specific window path) and collect all tags referenced/bound on that window? The functionality that is present in the Search/Replace would be perfect, but I want to redirect the referenced tag paths to a dataset.
The simplest and most complete way would be to query the tag reference tracker database if this is turned on and you have a version with it in it. This will include both statically bound tagpaths as well as dynamically bound tag paths via indirect tag bindings, the tag()
expression function (although you should never use this in the gui, only in expression tags), and tags read/written to via script, assuming the tag ref tool has been collecting references for long enough to capture all dynamically referenced tags.
Otherwise, if you want to do this outside of the designer, you'd need to ensure that your Vision Project Properties are set to save Vision resources as XML and not binary (and if it was binary, save all of your Windows, or at least the ones you want to extract tags from), and then process the xml files on the filesystem.
If you want to do it in the designer with the Window open, then you can write a script to run on the Window that will traverse each component and get any tag bindings on them (search the forum for how, I don't have the code off hand).
Note: the last two methods will not include dynamically referenced tags whereas the 1st option will, as long as the tag ref has been running for a while.
Great explanation! I will look into the tag reference tracker!
Note that one fundamental weakness of the tag reference tracker for this use case is that it aggregates all Vision references together under one lump "Vision" umbrella ; there's no disambiguation of where in Vision the reference is coming from.
I managed to write a script that does this from the window directly. I am utilizing binding adapters and property scanning to find tag paths. This probably won't work for expressions, but it is a fantastic place to start.
Ah, I didn't know that! Is that a can't do or a too hard to do? Maybe too much network traffic?
Mostly a "we're not doing as part of 'phase 1' of TRT" (a decision that was made outside of my hands). It would be a technical challenge due to the way tag subscriptions are managed by Vision, but not at all insurmountable.
Has Inductive ever considered a 'refactor tag name' functionality based on this tool? As a shameless request for more functionality goes, that would be an incredible tool to give users. I often find myself hesitating to change tag names because the name is so deeply embedded in the architecture of the project. If this is not on the docket for later addition to the codebase, is there a way to write a module that adds functionality to the tag right-click menu?