Message 1 of 3
Textbox string change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, i've encountered a problem with TextBoxes
I wrote a code that should just change the 26th TextBox in titleblock if it's a "part drawing".
I can read from this textbox just fine but when i try to change it's value i get an error
Does anyone know how to fix it?
Dim document As Document = ThisApplication.ActiveDocument Dim drw As DrawingDocument = document Dim titleBlock As TitleBlock = drw.ActiveSheet.TitleBlock Dim resultText As String = titleBlock.GetResultText(titleBlock.Definition.Sketch.TextBoxes(10)) Dim Iteration As Integer Iteration=1 While (Iteration < 100) resultText = titleBlock.GetResultText(titleBlock.Definition.Sketch.TextBoxes(Iteration)) Logger.Info(Iteration) Logger.Info(resultText) Iteration = Iteration + 1 If (resultText = "-GA drawing-" Or resultText = "part drawing" Or resultText = "-Assy drawing-") Exit While End If End While If (resultText = "-GA drawing-") Then resultText = titleBlock.GetResultText(titleBlock.Definition.Sketch.TextBoxes(18)) End If If (resultText = "-Assy drawing-") Then resultText = titleBlock.GetResultText(titleBlock.Definition.Sketch.TextBoxes(10)) End If If (resultText = "part drawing") Then Dim First As TextBox Dim Second As TextBox Dim Third As TextBox First = titleBlock.Definition.Sketch.TextBoxes(26) titleBlock.SetPromptResultText(First, "Text Needed") End If
Thanks in advance for all the answers 😄