kdo Posted October 17, 2010 Share Posted October 17, 2010 (edited) dear all, is it possible to search and select all text boxes based on a specific string of text or word in VW12.5.3 for example select all same markers (text fields containing B2) on a survey for further editing. kind regards, ds. Edited October 17, 2010 by kdo Quote Link to comment
Pat Stanford Posted October 18, 2010 Share Posted October 18, 2010 Not by default. You could write a Vectorscript that would select all text blocks that have a given bit of text. Could you use Find-Replace Text to do what you want? I think that was available in VW12.5. Quote Link to comment
kdo Posted October 18, 2010 Author Share Posted October 18, 2010 pat, thanks for getting back - unfortunately find and replace text does only replace text not select it... we are trying to separate out specific text (all on same class!) from a consultants drawing. thought about vectorscript, but since i have never used it before i am wondering if it is worth the effort. is it difficult to do and is there any good training material available? ds. Quote Link to comment
CipesDesign Posted October 18, 2010 Share Posted October 18, 2010 kdo, if you haven't done so already you might try "custom select" and set object type to "text" and class to the class in which the text resides. This will of course select every instance of text in that class, so you might need to de-select some text blocks manually. I am unsure of how many text blocks we are talking about here. Dozens? Hundreds? More? Quote Link to comment
Miguel Barrera Posted October 18, 2010 Share Posted October 18, 2010 I hope this is what you need. PROCEDURE SelStrInText; VAR searchStr: STRING; PROCEDURE ProcessTextObj(txtHdl: HANDLE); VAR layHdl: HANDLE; layName: STRING; curText: DYNARRAY[] of CHAR; BEGIN curText:= GetText(txtHdl); UprString(curText); {REMOVE THIS LINE IF YOU NEED TO MATCH TEXT CASE} IF Pos(searchStr,curText) > 0 THEN BEGIN SetSelect(txtHdl); {NEXT 3 LINES REPORT TEXT FOUND TO Output.txt IN USER'S DIRECTORY} layHdl:= GetLayer(txtHdl); layName:= GetLName(layHdl); WriteLn(layName,': ',GetText(txtHdl)); END; END; BEGIN searchStr:= StrDialog('Enter text to search',''); IF NOT DidCancel THEN BEGIN DSelectAll; UprString(searchStr); {REMOVE THIS LINE IF YOU NEED TO MATCH TEXT CASE} ForEachObject(ProcessTextObj,(INVIEWPORT & (T=TEXT))); END; END; Run(SelStrInText); 2 Quote Link to comment
Asemblance Posted June 5, 2019 Share Posted June 5, 2019 @Miguel Barrera Just stumbled across this and was exactly what I was after, works great thanks! Quote Link to comment
Miguel Barrera Posted June 6, 2019 Share Posted June 6, 2019 I am glad that it helped you Quote Link to comment
LaurieW Posted September 18, 2021 Share Posted September 18, 2021 Lovely! Just what was needed. Thanks! 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.
Note: Your post will require moderator approval before it will be visible.