Message 1 of 3
Replace text in dimensions in the drawing (holes, welds)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello.
1. question
I have the below code for replace text in an HoleThreadNote. Replace of the text "PRIEBEŽNE" to "Through" works fine. Replace of the text "HĹBKA" to "Depth" does not work. It is the same. Where is the problem?
2. question
Is it also possible to replace the text in the welding note?
Thank you
Sub Main()
Dim oDoc As Document
oDoc = ThisDoc.Document
If oDoc.DocumentType = kDrawingDocumentObject Then
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document
Dim oStylesMgr As DrawingStylesManager = oDrawDoc.StylesManager
Dim oDimStyle As DimensionStyle
oDimStyle = oStylesMgr.DimensionStyles.Item("Name_Of_Your_DimensionStyle")
Dim oSheet As Sheet
For Each oSheet In oDrawDoc.Sheets
oSheet.Activate
For Each oHoleThreadNote As HoleThreadNote In oSheet.DrawingNotes.HoleThreadNotes
oHoleThreadNote.FormattedHoleThreadNote = oHoleThreadNote.FormattedHoleThreadNote.Replace("PRIEBEŽNE", "Through") ' It is OK
oHoleThreadNote.FormattedHoleThreadNote = oHoleThreadNote.FormattedHoleThreadNote.Replace("HĹBKA", "Depth") ' It is NOT OK
oHoleThreadNote.Style = oDimStyle
Next
Next
oDrawDoc.Update()
End If
End Sub