Solid Edge Framework Type Library
EditFromClipboard Method
The name of the Variable object whose formula is to be edited.
Description
Edits the formula for the referenced Variable object.
Syntax
Visual Basic
Public Sub EditFromClipboard( _
   ByVal pName As String _
) 
Parameters
pName
The name of the Variable object whose formula is to be edited.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objVars As SolidEdgeFramework.Variables
    Dim objVar1 As SolidEdgeFramework.variable
    Dim objXLS As Excel.Workbook
    Dim objSheet As Excel.Worksheet
    Dim objCell As Excel.Range
    Const XLS_FILE = "T:\vbtests\testcases\Variables.xls"
    ' 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 the Varialbes collection
    Set objVars = objDoc.Variables
    'Create a variable
    Set objVar1 = objVars.Add(pName:="Length", pFormula:="1.0 in")
    'Set the variables formula to someThing else
    objVar1.Formula = "2*1.5 "
    'Open the XLS application and the XLS file and copy the cell into ClipBoard
    Set objXLS = GetObject(XLS_FILE)
    Set objSheet = objXLS.ActiveSheet
    Set objCell = objSheet.Cells(2, 2)
    Call objCell.Copy
    'Edit the variable Formula to be linked to the XLS cell
    Call objVars.EditFromClipboard(pName:="Length")
    objXLS.Close False
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objVars = Nothing
    Set objVar1 = Nothing
    Set objXLS = Nothing
    Set objSheet = Nothing
    Set objCell = Nothing
End Sub
See Also

Variables Collection  | Variables Members