Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Convert a non-fitted textbox back to fitted

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
smilinger
400 Views, 2 Replies

Convert a non-fitted textbox back to fitted

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.

2 REPLIES 2
Message 2 of 3
dgreatice
in reply to: smilinger

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

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 3 of 3
smilinger
in reply to: dgreatice

Yeah, I know that. It seems no other solution.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report