Author Topic: Macro - Extract Text and Open MS-Word to Spell Check  (Read 842 times)

SEJ

  • Newbie
  • *
  • Posts: 30
Macro - Extract Text and Open MS-Word to Spell Check
« on: February 10, 2016, 01:43:16 PM »
I posted this recently as a reply in the context of another post asking about spell checker for DC. I felt it might do more good over here.

I created, and have been using this for awhile. I cleaned it up some, to bring here.

This @Text_Export.d3m Macro finds all text in a 2d drawing (I haven't tried on a 3D drawing), strips numbers, and writes word/entities bigger than 2 characters to a .doc file. It then opens MS-Word and the .doc, and if you follow the instructions Word will spell check your text for the entire drawing with a couple of keystrokes (well 3 anyway).

No guarantees expressed or implied. 
You may want to test on a copy of your favorite drawing until you're sure it's not going to mess it up.

You may have to alter the file paths in the macro to make it work, there are some comments to help. I'm running Win-7 Pro, and MS-Office 2007 so the path to your MS-Word may be different.

I'll be glad to answer questions and take reasonable suggestions under consideration.
Please realize, I'm no expert on BasicCad, just like to hack away at problems.
If you are going to fly by the seat of your pants, expect friction burns.

samdavo

  • Hero Member
  • *****
  • Posts: 2587
  • the trick is knowin...^ > v < - which way's up?
Re: Macro - Extract Text and Open MS-Word to Spell Check
« Reply #1 on: February 11, 2016, 12:01:55 PM »
Howdy SEJ
Thanks for your efforts here .  I tried it out (curious about the "Greeting Earthlings" lol - unfortunately received a message, "A GOSUB statement is nested too deeply"  etc .   Over to you mate.  I'm just the messenger :)  Thanks again.
Cheers

samdavo

  • Hero Member
  • *****
  • Posts: 2587
  • the trick is knowin...^ > v < - which way's up?
Re: Macro - Extract Text and Open MS-Word to Spell Check
« Reply #2 on: February 11, 2016, 02:38:05 PM »
Steve
Just experimenting with that drawing of mine (a bit commercially sensitive so I won't post it as it is),
All I can say is that your macro works sometimes and not others.    Weird illogical results.

Incidentally it is not a large drawing, -  when it does work, it says there are 81 strings to check out in Word.
Beats me (at the moment), but I will persevere.
 
(V22 and Windows 7 incidentally).



SEJ

  • Newbie
  • *
  • Posts: 30
Re: Macro - Extract Text and Open MS-Word to Spell Check
« Reply #3 on: February 11, 2016, 02:53:49 PM »
I notice that if the macro chokes, then if you don't reload the drawing, it'll sometimes have problems.  Sometimes I've even had to log-off of Win-7 to clear DC itself. I don't have any error checking in the macro, and most likely it's made changes to the drawing (it explodes all dimensions, and then does an appropriate "Undo" commands to put them back together) so the counts and other aspects get deflueggled when it errors before ending.

If you're willing, you might send me a drawing with all of the vector and line items removed if you haven't learned the feature already, (shift-f, entity-type tab, and add to selection, then delete).

Steve
If you are going to fly by the seat of your pants, expect friction burns.

samdavo

  • Hero Member
  • *****
  • Posts: 2587
  • the trick is knowin...^ > v < - which way's up?
Re: Macro - Extract Text and Open MS-Word to Spell Check
« Reply #4 on: February 11, 2016, 03:03:32 PM »
Steve
Could this be (part of) the cause :-
I have a number of dimensions which have a "suffix" added which adds text to the number.
I note when you run your macro, it explodes all that.
And if I then run your macro a few more times, it seems to work ok (2 cents)
cheers
sam

Dr PR

  • Hero Member
  • *****
  • Posts: 5378
Re: Macro - Extract Text and Open MS-Word to Spell Check
« Reply #5 on: February 11, 2016, 09:34:16 PM »
Here is a caution about "Undo." The program may go off into never-never land for quite a while during the Undo operation. The length of time seems to depend upon the number of objects involved in the Undo and the total number of objects in the drawing.

By "quite a while" I mean up to 5 minutes for each Undo in a large drawing. If the macro is repeating the Undo many times the program could be hung up for hours.

Phil
DesignCAD user since 1987

SEJ

  • Newbie
  • *
  • Posts: 30
Re: Macro - Extract Text and Open MS-Word to Spell Check
« Reply #6 on: February 12, 2016, 05:59:20 AM »
Dr PR, you're right, I had that experience when I first started trying to use the 'undo'.  I would also get an error about too many undo's which is why it now count the explodes to limit the undo's. 

Not a perfect solution, but I was trying to put the drawing back to its original form, and not leave the dimensions all exploded (which also changes the font weight or something in my drawings).

I also forget that my drawing regen speed is several times faster than the norm because of my use of an SSD and RamDisk.

I'll try to think of an alternate program process 'method' to get the results.
Any suggestions??
If you are going to fly by the seat of your pants, expect friction burns.