Edit text ilogic form

Edit text ilogic form

mds1312
Participant Participant
785 Views
1 Reply
Message 1 of 2

Edit text ilogic form

mds1312
Participant
Participant

Hi

 

I have this grid template i use for my layouts I would like to edit text from my form.. How to do???

In attached part I have it to work with the number but not with letters

0 Likes
786 Views
1 Reply
Reply (1)
Message 2 of 2

Vladimir.Ananyev
Alumni
Alumni

Your part document contains 10 text boxes.  You may change both text size and value in the given TextBox object if redefine its FormattedText property.  See also this discussion.

Private Sub EditTextBox()
    
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    Dim oDef As PartComponentDefinition
    Set oDef = oDoc.ComponentDefinition
    Dim oSketch As PlanarSketch
    Set oSketch = oDef.Sketches.Item("Moule")
    
    oSketch.Edit
    
    Dim oTextBoxes As TextBoxes
    Set oTextBoxes = oSketch.TextBoxes
    
    'reference to the 2nd text box  (letter B)
    Dim oTextBox As TextBox
    Set oTextBox = oTextBoxes.Item(2)
    'current text  height
    Dim TextHeight As Double
    TextHeight = oTextBox.FittedTextHeight
    'new text value
    Dim St As String
    St = "BBBBB"
    'change formatted text
    oTextBox.FormattedText = "<StyleOverride FontSize='" & CStr(TextHeight) & "'>" & St & "</StyleOverride>"
    
    oSketch.ExitEdit
    oDoc.Update
    Beep
End Sub

You should be able to control FormattedText property from iLogic rule.

Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes