×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Spell Check Macro?

Spell Check Macro?

Spell Check Macro?

(OP)
I was trying to build a spell checker in CATIA V5. I want the macro to check every word in a drawing file with an Excel sheet which has all the words predefined. How do I start this.

Thanks!

RE: Spell Check Macro?

learn about:
operations on strings (extracting single word from string, compare two words)
how get all DrawingTexts (If You only consider drawingtexts)
how collaborate with Excel spreadsheet through CatScript / CATVBA

LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013

RE: Spell Check Macro?

(OP)
Thanks Much for your ideas!!.

RE: Spell Check Macro?

search for all texts in drawing:

CODE --> VBSCRIPT

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 --> VBSCRIPT

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

RE: Spell Check Macro?

(OP)
I was just going through the excel forums and found the following code which checks the spelling of all the cells. What I though is to first capture all the words from CATIA into an excel and then use the excel spell checker to check the spellings. But I have a doubt w.r.t the word (sentence) indexing i.e., the way catia names different words. I hope it is based on how I create the text right? Say, if I create "ABCD XYZ" in one go, that would be identified as single text in CATIA right. Please clarify

Option Explicit
Sub CheckSpekk()


With Application.SpellingOptions
.SuggestMainOnly = True
.IgnoreCaps = True
End With

' Run a spell check.
Cells.CheckSpelling

End Sub

RE: Spell Check Macro?

Hello, I've got good news for You, following by Ferdo's suggestions, I've created catia's macro that collaborate with MS Word dictionaries

To compile this Macro You need to add MS Word Library
From menu Tools-References Check Microsoft Word XX Library

Here is the whole macro
http://szczypin.pl/data/uploads/makra/spellchechke...

I'm looking for Your feedback!


LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013

RE: Spell Check Macro?

Lukaszsz,
Works Great!
Thanks for developing.

I am running it on V5R18SP4 64-bit windows 7.
Every other time I run it, I get a "Run-time error '462': The remote server machine does not exist or is unavailable"
If I select End it works fine the next time.
IF I select Debug it goes to the the editior and highlights this line "WordApp.Visible = False"

I have not tried it on later Catai versions.


Thanks,
Rick

RE: Spell Check Macro?

Same error on my configuration (V5r21 Win7x32), I haven't 'marked' it as urgent mistake, I'm still working on it and still haven't found suitable solution smile

LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013

RE: Spell Check Macro?

(OP)
Thank you very much for developing the macro LukaszSz!

I did not get any errors when I compiled it, but it works only with one text. When there are multiple texts, it detects them but doesn't give any spelling suggestions.

RE: Spell Check Macro?

Meghanath, Try to download the latest version. Previous ver contains some bugs, e.g. looping on first drawing text only instead all texts. Link is the same, I've uploaded the new one (240 kb) few days ago.
Also I've fixed multilanguage supporting. Previous version was using suggested words not from specified language library, but from same language as system's language

LukaszSz. Poland, Warsaw University of Technology, Faculty of Power and Aeronautical Engineering : MEchanical Engineering. BsC - 2013

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources