EBDN - Community - Question & Answers

  Friday, 04 May 2018
  1 Replies
  1.8K Visits
0
Votes
Undo
Hello,

I want to replace the text in a textblock on a drawing using the SheetBop function aucOpExecSheetSetTranslateTexts.
The code runs without error, but the text is not replaced.




SetSingleTextblocksTest "00000000-0000-0000-0000-000000CC1B87","Barbapapa"

Public Sub SetSingleTextblocksTest(SymbolOid As String, TextOrRef As String)
Dim oSheet As Sheet
Dim aParams() As Aucotec.AucExecuteSheetOperationRecord
Dim aTranslates(0) As TAucTranslateTextData
Dim lIdx As Long

Set oSheet = Application.Selection(1)

If oSheet.IsOpened = False Then
Debug.Print "Opening Sheet"
oSheet.Open (aucSheetOpenAutosave)
Else
Debug.Print "Sheet already open"
End If

ReDim aParams(1 To 2)

aTranslates(0).SymbolOid = SymbolOid
aTranslates(0).TextOrReference = TextOrRef
bCloseSheet = bCloseSheet

aParams(1).qual = aucOpExecSheetSetTranslateTexts
aParams(2).qual = aucArgExecTranslateTexts
aParams(2).Val = aTranslates

Call Application.Utils.ExecuteSheetOperation(oSheet, aParams)

End Sub



Any help is appreciated.

Regards

Stefan Hofmann