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: 

Read / Change Prompted entry through code from titleblock

3 REPLIES 3
Reply
Message 1 of 4
GeorgK
778 Views, 3 Replies

Read / Change Prompted entry through code from titleblock

Hello together,

 

how could I read / change prompted entry through code from titleblock (for example DIN) within VB.Net?

 

Thank you Georg

 

 

3 REPLIES 3
Message 2 of 4
GeorgK
in reply to: GeorgK

How could I get the order for the items (for the array)?

Message 3 of 4
tuliobarata
in reply to: GeorgK

I made something like that some days ago, my code is very simple, using parts from the Programming help, but its working :).

 

I just put it linked to a form and some parameters, So ai can change the text from any Prompted Entry in the title block:

 

I cleaned the code because it was too long, if you dont understand plz post it, that ill try explain a little better:

Imports  Inventor.UnitsTypeEnum
' Create Custom Paramteres if not done.Dim oPartDoc as DrawingDocument = ThisDoc.Document
Dim userParams As UserParameters = oPartDoc.Parameters.UserParameters
Dim parametro As String


Dim oSheet As Sheet
Dim oTitleBlock as TitleBlock
Dim oTextBox As TextBox
Dim oTextBoxes as TextBoxes

Dim carimbo As String

oSheet = ThisApplication.ActiveDocument.ActiveSheet

    If oSheet.TitleBlock Is Nothing Then Exit Sub

    oTitleBlock = oSheet.TitleBlock

        If oTitleBlock.Definition.Sketch.TextBoxes Is Nothing Then Exit Sub

        oTextBoxes = oTitleBlock.Definition.Sketch.TextBoxes







'---------------------------------------------------------------------------------------------------------------'read the Prompted entryTry
parametro = "PROMPTED ENTRY PARAMETER NAME"
  i = oPartDoc.Parameters(parametro)
  Catch
  
      For Each oTextBox In oTextBoxes
            If oTextBox.Text = "PROMPTED ENTRY NAME" Then Exit For
            Next                
                
                If oTitleBlock.GetResultText(oTextBox) = "X" Then
                    criacao = True
                Else
                    criacao = False
                End If

      Dim newParam As UserParameter = userParams.AddByValue(parametro,criacao,kBooleanUnits)
  End Try
'---------------------------------------------------------------------------------------------------------------
'------------------------------
        
        
'write the Prompted entry            For Each oTextBox In oTextBoxes
            If oTextBox.Text = "PROMPTED ENTRY NAME" Then Exit For
            Next
                If Parameter("PROMPTED ENTRY PARAMETER NAME") = True Then
                carimbo = "X"
                Else
                carimbo = ""
                End If
                
                If oTextBox Is Nothing Or oTextBox.Text <> "Botão - P/ Referência" Then Exit Sub

                oTitleBlock.SetPromptResultText( oTextBox, carimbo )



IV 2013
Message 4 of 4

GeorgK,

 

one more blog may help you:

 

http://adndevblog.typepad.com/manufacturing/2012/07/getset-the-prompted-text-in-the-border-of-a-shee...

 

Please mark tuliobarata's message as a solution if you think it helps you.

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

Post to forums  

Autodesk Design & Make Report