Pass vb.net variables to parameters in Inventor

Pass vb.net variables to parameters in Inventor

18297BQ37M
Explorer Explorer
653 Views
4 Replies
Message 1 of 5

Pass vb.net variables to parameters in Inventor

18297BQ37M
Explorer
Explorer

Could someone help me or recommend tutorials that connect vb.net with inventor, since I would like to pass vb.net variables to inventor parameters

0 Likes
Accepted solutions (1)
654 Views
4 Replies
Replies (4)
Message 2 of 5

A.Acheson
Mentor
Mentor

Hi @18297BQ37M ,

Can you please provide a sample/sudo code of what your looking to achieve? Here is how to create a user parameter and set parameter value from API help. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 5

18297BQ37M
Explorer
Explorer

I am looking to send the values that are entered in the text Boxes and send them to the parameters as shown in the image

18297BQ37M_0-1662403170697.png

 

0 Likes
Message 4 of 5

A.Acheson
Mentor
Mentor

Set up a sub routine and pass in the textbox value. If you need more assistance please post the complete code your using. 

 

Public Sub SetParameters()
    ' Get the active document.  Assumes a part document is active.
    Dim partDoc As PartDocument = ThisApplication.ActiveDocument
   
    Dim oParam As Inventor.Parameter = partDoc.ComponentDefinition.Parameters.Item("Archo")
    
    ' Change the equation of the parameter with variable coming from text box.
    oParam.Expression = txtformArcho      ' "3.5 in"
    
    ' Update the document.
    ThisApplication.ActiveDocument.Update
End Sub

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 5 of 5

A.Acheson
Mentor
Mentor
Accepted solution

Here is a few link to tutorials also. Search winforms and inventor. Link1 and link2 You will have to declare and access objects differently than the ilogic environment so pay attention to getting the inventor application at the beginning.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes