Actually I am trying to connect to solidworks through visual studio 2013.I am getting an error stating:" A first chance exception of type 'System.NullReferenceException' occurred in WindowsApplication1.exe / Object reference not set to an instance of an object" . Showing Documents as nothing because of which getting error in line "For Each Doc As ModelDoc2 In Documents".
Public Sub New()
SwApp = New SldWorks.SldWorks
Dim Documents As Object = SwApp.GetDocuments()
For Each Doc As ModelDoc2 In Documents
_observableModeldoc.Add(New Modeldocs(Doc.GetPathName, _SwApp))
Next
End Sub
Can anyone please suggest any solution..?
SwApp.GetDocuments().Countreturn? Please note that I havent worked on Solidworks.