Norm Kirchner Posted October 29, 2009 Report Share Posted October 29, 2009 I'm working on a plug-in architecture that starts from a template. But across all the VI's in said template is the word template. labels, descriptions and so on. As part of my plug-in springboard application (which takes the template and starts you up on a mostly created plugin) I would like to find and replace all instances of the word template w/ the word of their choosing. And as a new way of operating, I'm trying to avoid going straight to the LV devleopers downstairs to ask questions and start here, (and if they chime in, I'll impart their knowledge here) So it feels that someone must have done this by now, I know that I could code it up manually, but if it's done, why should I? Quote Link to comment
Darren Posted October 29, 2009 Report Share Posted October 29, 2009 The VI Analyzer Spell Check test harvests all the words from a VI...you could probably steal some of its code to find words and replace them. -D Quote Link to comment
jcarmody Posted October 29, 2009 Report Share Posted October 29, 2009 I would like to find and replace all instances of the word template w/ the word of their choosing. Darren Nattinger wrote about "TRef Traverse for References.vi" here. I used it to write a simple requirements coverage tool that looks for and highlights free labels. I believe I could use it to find/replace any text if I knew what class names to traverse for. Quote Link to comment
ShaunR Posted October 30, 2009 Report Share Posted October 30, 2009 (edited) Its not too hard to find and replace text. Passa Mak does it for controls, indicators and tip strips. It also has a diagram scanner to extract string constants. It wouldn't take much of an imagination to modify the the relevent bits for descriptions, revision history, decoration text etc. Although its not designed for regex replacements, it covers a lot of the bases you'd need or, at the very least, show you how to go about it. Edited October 30, 2009 by ShaunR 1 Quote Link to comment
jcarmody Posted October 30, 2009 Report Share Posted October 30, 2009 Could you post a snippet from Passa Mak (or, a few) to show how you're finding all of the label (tags), captions, tip strips and any ancillary text (such as graph axis, plot names etc) of all controls and indicators on the front panels and any string diagram constants that have their captions (or labels for digrams) visible to a number of language files I don't have LabVIEW 2009. Quote Link to comment
ShaunR Posted October 30, 2009 Report Share Posted October 30, 2009 (edited) Could you post a snippet from Passa Mak (or, a few) to show how you're finding all of the I don't have LabVIEW 2009. It grabs all controls from a FP. Then extracts the labels and text dependent on the control type. PM Get Control Text.vi uses recursion so it will drill down into nested clusters. Passa Mak creates a list to save to a file since the save and load are separate, but for a regex replacement you could put a write node immediately after the read node in the PM Get Control Text.vi and modify the string in between. Edited October 30, 2009 by ShaunR 1 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.