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