search for all texts in drawing:
Code:
Language="VBSCRIPT"
Sub CATMain()
Set drawingDocument1 = CATIA.ActiveDocument
Set selection1 = drawingDocument1.Selection
selection1.Search "CATDrwSearch.DrwText,in"
for i=1 to selection1.count
msgbox selection1.item(i).value.text
next
End Sub
disassembly text into single word - split string by " " (SPACE)
Code:
Sub disassemblyText(oString)
SplittingChar=" "
ArrayOfSingleWords = split(oString,SplittingChar)
for j=LBound(ArrayOfSingleWords) to UBound(ArrayOfSingleWords)
msgbox ArrayOfSingleWords(j)
next
End Sub
LCase() and UCase() will replace all letters into lower cases / upper cases
two steps almost done, I hope, You'll post Yours version soon, anyway, it seems to be very interesting case, so if I get some free time, I will prepare my own version of SpellChecker for CATIA's drawing texts
IMO the biggest problem is to determine, how script should work, when script will found word from outside the WordList
The best option IMO is to do it in VBA, create table of all words and founded highlit on green, those, which are outside the wordlist on red and let user to do those changes manually by double-click on this word
LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013