AnsweredAssumed Answered

Writing a variable value within a Task (EPDM)

Question asked by Mario Zahren on Apr 28, 2016
Latest reply on May 2, 2019 by Mario Zahren

Hello all,


I want to write a value into a datacard field during Task execution (Convert Task -> SolidWorks Drawint to DWG)

For debugging I copied the code, using "debug.assert False",  from the Task into SolidWorks VBA-Editor.

Unfortunately I can´t figure out how to do that. I can not find a solution for "setvar" in VBA.

Can anybody help?

Cheers Mario


The code I use so far:


 convFileName = ParseFilename(docFileName, convFileName)

    convFilePath = Left(convFileName, InStrRev(convFileName, "\"))
    CreatePath convFilePath
    convFileName = convFileName & ext
    'Dateiname DWG verfügbar "convFileName"
    'Call Function
    VarValueCustExt = SetVariableValue(convFileName, "Conf2", "Model", VarValueCustExt)

Private Function SetVariableValue(FilePath, VariableName, Configuration, VarValueCustExt)

    Call LoginToVault
    On Error GoTo ErrHand

    Dim File As Object
    Dim Folder As Object

    Set File = vault.GetFileFromPath

    Dim pEnumVar As Object

    Set pEnumVar = File.GetEnumeratorVariable

    pEnumVar.SetVar(VariableName, Configuration, VarValueCustExt, False)

    'Dim value As Variant

    If pEnumVar.SetVar(VariableName, Configuration, VarValueCustExt) Then
        Set SetVariableValue = VarValueCustExt
         SetVariableValue = ""
    End If

    Exit Sub

        Dim ename As String
        Dim edesc As String

        vault.GetErrorString Err.Number, ename, edesc
        Log "GetvariableValue error" & vbCrLf & ename & vbCrLf & errdesc
End Function