I'm trying to pull stress results for specific nodes from Solidworks Simulation. I cannot seem to get the GetStressComponentForAllStepsAtNode to work. The code below gives me a VB Run-time error '91': Object variable or With block variable not set. When I choose debug it highlights this line
value = instance.GetStressComponentForAllStepsAtNode(NComponent, NNodeNum, DispPlane, NUnits, status)
This is my VB macro:
Sub main()
Dim instance As ICWResults
Dim NComponent As Long
Dim NNodeNum As Long
Dim DispPlane As Object
Dim NUnits As Long
Dim status As Long
Dim value As Object
NComponent = 0
NNodeNum = 4139
NUnits = 1
status = 0
value = instance.GetStressComponentForAllStepsAtNode(NComponent, NNodeNum, DispPlane, NUnits, status)
End Sub
I should also add that I have also tried the following line which is what is included in the solidworks simulation api example for similar functions:
value = instance.GetStressComponentForAllStepsAtNode(NComponent, NNodeNum, Nothing, NUnits, status)
I get the same error as stated above
