AnsweredAssumed Answered

Why does this error???

Question asked by Kyle Thomson on Jul 20, 2020
Latest reply on Jul 21, 2020 by Frederick Law

Do you know why this would generate an error saying "argument not optional". I created a 2x2x2 cube in simulation and applied thermal loads to it. Then I ran the simulation and then tried to run the code to read the values.


Dim SwApp As SldWorks.SldWorks

Option Explicit


Dim CWResult As ICWResults
Dim NComponent As Integer
Dim NNodeNum As Integer
Dim DispPlane As Object
Dim NUnits As Integer
Dim ErrorCode As Integer
Dim value As Object
Dim Temps As String

Sub main()
Temps = CWResult.GetThermalComponentForAllStepsAtNode(swsThermalComponentTEMP, 1, , swsTemperatureUnitKelvin, swsResultsErrorSuccessful)

Set SwApp = Application.SldWorks
Debug.Print "Getting thermal results..."
Set CWResult = Results

n = FreeFile()
Open "E:\LCDRIVES\test1234.txt" For Output As #n

s = Temps
Debug.Print s ' write to immediate
Print #n, s ' write to file
Set SwApp = Application.SldWorks
End Sub