Changing languages on drawings

I know companies that spend a lot of money translating drawings. Typically it is a slow, tedious, manual process. Since often times the translators aren’t engineers, you can sometimes get embarrassing translations.

If your standard notes are blocks, translating these notes can be done very quickly.

SOLIDWORKS’ blocks have a “FileName” property that a macro can easily change. Change the “FileName” property and the block immediately changes to the new block. So if you are clever about your block naming strategy, a small macro can be used to quickly change your notes from one language to another.

I break my notes in folders by language:


For example above I have three “Chamfer.sldblk” files. All with the same file name but defined with different languages as the text within the block.

The English version is in: “c:vaultnameStandard NotesEnglishChamfer.sldblk
The French version is in: “c:vaultnameStandard NotesFrenchChamfer.sldblk
The Mandarin version is in: “c:vaultnameStandard NotesMandarinChamfer.sldblk

This little SOLIDWORKS macro snip cycles through all of the notes in a drawing, looks at their path, if it finds the word “English” in the block’s file path, the block gets changed to the “French” version.

 Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim vBlockDef As Variant
Dim SwSketchMgr As SldWorks.SketchManager
Dim swBlockDef As SldWorks.SketchBlockDefinition
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.ActiveDoc
Set swDraw = swModel
Set SwSketchMgr = swModel.SketchManager
vBlockDef = SwSketchMgr.GetSketchBlockDefinitions
If Not IsEmpty(vBlockDef) Then
For i = 0 To UBound(vBlockDef)
Set swBlockDef = vBlockDef(i)
swBlockDef.FileName = Replace(swBlockDef.FileName, "English", "French")
Next i
End If
  • Share this
Find Your Design Solution in the CATI Store.
Browse Products