12-07-2022
07:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-07-2022
07:06 PM
Thanks for all the help!
I did eventually come across some tucked away forum thread, turns out all i had to do was remove ".Style" from the oTextBox.Style.Color ahaha.
So that section looks like this now:
oFile = ThisApplication.Documents.Open(oDocument, True) 'Create Job Number/Qty Text Box on the idw Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSketch As DrawingSketch = oDrawDoc.ActiveSheet.Sketches.Add Dim oRed As Color = ThisApplication.TransientObjects.CreateColor(255, 0, 0) oSketch.Edit Dim oTG As TransientGeometry = ThisApplication.TransientGeometry ' Dim sFormattedJB As String Dim StartOv As String = "<StyleOverride FontSize = '0.6' > " Dim EndOv As String = "</StyleOverride> " Dim JBText As String = jobNum & vbCrLf Dim QtyText As String = "QTY: " & Qty Dim oTextBox As Inventor.TextBox oTextBox = oSketch.TextBoxes.AddFitted(oTG.CreatePoint2d(10, 4), StartOv & JBText & QtyText & EndOv) oTextBox.Color = oRed oSketch.ExitEdit
We played around with the <StyleOverride> controls as well, but I imagine having just done oTextBox.FontSize = 0.8 would have worked too.
Thanks again.