Can anybody help me out in how to retrive the value of the external loads of the existing Simulation study?
I can find the study name,type etc , but could not find out the API for retriving the value of loads.
Below is the sniplet of my code.
Sub main()
Set SwApp = CreateObject("SldWorks.Application")
Set cwAddin = SwApp.GetAddInObject("SldWorks.Simulation.2")
If cwAddin Is Nothing Then ErrorMsg SwApp, "cwAddin not found", True
Set cwApp = cwAddin.COSMOSWORKS
Set ActDoc = cwApp.ActiveDoc
If ActDoc Is Nothing Then ErrorMsg SwApp, "No active document.", True
Set StudyMngr = ActDoc.StudyManager()
If StudyMngr Is Nothing Then ErrorMsg SwApp, "Error accessing StudyMngr object.", True
StudyCnt = StudyMngr.StudyCount
If StudyCnt < 1 Then ErrorMsg SwApp, "No simulation studies exist.", True
For i = 0 To StudyCnt - 1
Set Study = StudyMngr.GetStudy(i)
Set solidmngr = Study.SolidManager
Debug.Print "Analysis Name is " + CStr(Study.Name)
Set LAndRMngr = Study.LoadsAndRestraintsManager
Debug.Print "The Active loads are " & CStr(LAndRMngr.Count)
For k = 0 To LAndRMngr.Count - 1
Set LAndR = LAndRMngr.GetLoadsAndRestraints(i, 0)
Debug.Print "Load Name " & LAndR.Name
Debug.Print "Load Type " & LAndR.Type
enumrestype = LAndR.Type
Debug.Print "enum val is " & enumrestype
Next k
Next i
End Sub
Thanks in advance
Gautam Kulkarni
SolidworksApi macros