Edit Method in the Variables Collection Example in C#

Valued Contributor
Valued Contributor

There is this VB.net example on SE programming help. Anyuthing Similar on C#? Please....

 

Private Sub Form_Load()
    Dim objApp As SolidEdgeframework.Application
    Dim objDoc As SolidEdgepart.PartDocument
    Dim objVariables As SolidEdgeframework.Variables
    Dim objVariable As SolidEdgeframework.variable
    ' Report errors    Const PI = 3.14159265358979
    ' Create/get the application with specific settings    On Error Resume Next
    Set objApp = GetObject(, "SolidEdge.Application")
    If Err Then
        Err.Clear
        Set objApp = CreateObject("SolidEdge.Application")
        Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    'Get Variables Collection    Set objVariables = objDoc.Variables
    'Create a variable with Add method    Set objVariable = objVariables.Add(pName:="Variable1", pFormula:="100.0")
    'Modify the formula of the varialbe with Edit method    objVariables.Edit pName:="Variable1", pFormula:="Sin(30)"
    ' USER DISPLAY    ' Release objects    Set objApp = Nothing
    Set objDoc = Nothing
    Set objVariables = Nothing
    Set objVariable = Nothing
End Sub
2 REPLIES

Re: Edit Method in the Variables Collection Example in C#

Phenom
Phenom

Have you checked the Solid Edge samples ?

~Tushar

 

Re: Edit Method in the Variables Collection Example in C#

Valued Contributor
Valued Contributor

Thanks, Tushar

 

I translated, it's working, but thanks for the link for more examples.