tapped hole callouts

I wish to be able to change a batch of detail drawings hole callouts from M10 x 1.5 Tapped Hole to M10 x 1.5 -6H and was wondering if there is a way to access the text in a find and replace all kind of way external to sw. I wish then to be able to change the hole wizard defaults to use -6H instead of Tapped Hole on all future cosmetic thread callouts. I recall having seen some posts in the past that refer to the .mdb files that contain this data.

Reply to
skiboat
Loading thread data ...

I'm not sure of a quick way to change all existing callouts, maybe one of the API gurus can help you. I do know, however, how to make the change to the default to get rid of the ridiculous "tapped hole" callout. You are right in assuming you must modify the mdb files. I think the one you need to mess with is ansimetric.mdb. You'll need MS Access to open these files. Copy this file as a backup and then make your changes. I believe your change is simple in that on the Index tab you simply need to replace "Tapped Hole" with "-6H". Save the file and start SWX. Model a metric hole and see if the callout changed. If you want to go back to the original you need to open your safety copy of ansimetric.mdb and save without making changes. For some reason the date stamp is important to SWX in that you can't go back to an earlier version without making the date code more current than your recently modified file.

I did a whole big write-up on this a while back so search the group for it. Search ansiinch and you'll find it.

Mickey

Reply to
Mickey Reilley

Thanks Mickey - that worked a treat, in the index tab for future tap callouts

Reply to
skiboat

actually if you replace this line

If swNote.GetText = FindText Then

with this line

If LCase(swNote.GetText) = LCase(FindText) Then

then the macro would no longer be case sensitive

Regards Corey

Reply to
Corey Scheich

Corey - I changed the find and replace routine to include some other tap descriptions. My attempts at wildcarding before Tapped Hole didn't work! The lowercase mod works as well - thanks again

Set Part = swApp.ActiveDoc 'this function is case sensitive and only searches for a whole note match 'if your notes are all identical you can use this with no mods except 'changing the find and replace text. Otherwise you might have to do a bit 'of work ' FIND REPLACE FindAndReplace "M6X1.0 Tapped Hole", "M6x1.0 -6H" FindAndReplace "M8X1.25 Tapped Hole", "M8x1.25 -6H" FindAndReplace "M10X1.5 Tapped Hole", "M10x1.5 -6H" FindAndReplace "M12X1.75 Tapped Hole", "M12x1.75 -6H" End Sub

Reply to
skiboat

you will have to do something like search the string for tapped hole use

position = instr (1, LCase(swNote.GetText),LCase(FindText),vbTextCompare)

use the position variable in your if statement instead of

If LCase(swNote.GetText) = LCase(FindText) Then

that will return a number if the string is found representing the location of the text you are looking for. ("Tapped Hole") You can then use this value like this

swNote.SetText = Left(swNote.GetString, Position) & "-6H Tapped Hole"

maybe ,Position - 1)

if you incorporate this right it will change any note that has the words Tapped Hole in it, if you really get into it you can add a form to this all and make it do a find next thing just like in word but that would take a bit of work.

Reply to
Corey Scheich

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.