Solid Edge Framework Type Library
PutName Method
Specifies the Variable object for which to change the name.
Specifies the new name to give to the Variable object.
Description
Changes the name of the referenced Variable object.
Syntax
Visual Basic
Public Sub PutName( _
   ByVal pVariable As Object, _
   ByVal pName As String _
) 
Parameters
pVariable
Specifies the Variable object for which to change the name.
pName
Specifies the new name to give to the Variable object.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeframework.Application
    Dim objDoc As SolidEdgepart.PartDocument
    Dim objVariables As SolidEdgeframework.Variables
    Dim objVariable As SolidEdgeframework.variable
    Dim strName As String
    ' 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")
    strName = "Var1"
    'Change the Name of the Variable with PutName method
    objVariables.PutName pvariable:=objVariable, pName:=strName
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objVariables = Nothing
    Set objVariable = Nothing
End Sub
See Also

Variables Collection  | Variables Members