When creating a new titleblock of border, in the definition sketch we can add a textbox in two ways:
1. By single click, this way the textbox created is a fitted textbox, the width of the textbox can auto grow or shrink based on the text, and it's a single line textbox no matter how long the text is or whether there is whitespace or not.
In code this kind of textbox can be created using DrawingSketch.TextBoxes.AddFitted(), the Fitted property of the textbox object is True.
2. By click and drag a box, this way the textbox is non-fitted textbox.
In code this kind of textbox can be created using DrawingSketch.TextBoxes.AddByRectangle(), the Fitted property of the textbox object is False.
A fitted textbox can be converted into non-fitted textbox, by dragging the corner of the textbox, or from code by set the height or width value of the textbox.
Now the question is, can I convert it back? For some reason I want to convert all my textboxes to fitted textbox. I found no inventor command to do this, and I found no way to do it in code.
Solved! Go to Solution.
Solved by dgreatice. Go to Solution.
Hi,
maybe we cant convert to fitted but we can replace with new text fitted, like this:
Dim oDwg As DrawingDocument
Set oDwg = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Set oSheet = oDwg.ActiveSheet
Dim oGenNotes As GeneralNote
Dim oPoint As Point2d
For Each oGenNotes In oSheet.DrawingNotes
If oGenNotes.Fitted = False Then
X = oGenNotes.Position.X
Y = oGenNotes.Position.Y
Field = oGenNotes.Text
Set oPoint = ThisApplication.TransientGeometry.CreatePoint2d(X, Y)
oGenNotes.Delete
Call oSheet.DrawingNotes.GeneralNotes.AddFitted(oPoint, Field)
End If
Next
Can't find what you're looking for? Ask the community or share your knowledge.