AnsweredAssumed Answered

TaskpaneView and access to the solidworks objects

Question asked by 1-LUTL00 on Sep 3, 2009
Latest reply on Sep 4, 2009 by Rajat Jain

Hello everyone,


I have just created (in C#) a TaskPaneView

(that sidebar in  Solidworks on the RHS). It  displays a list of standard parts that I get from a database This part works well and I open it with the following  code:


TaskpaneView myTaskPane = SwApp.CreateTaskpaneView2( null, "Standard Parts Library" );



Where the “MyApp.StdParts” is the  name of the class I’m using. Unfourtunetly when I try and access the  solidworks ModelDoc2, iSwApp or any of the solidworks objects it doesn’t work as  they are all null.


This is only the case from within the StdParts class. In the main function I'm using for other non sidebar related issues "SwAddin" it works just fine accessing all the solidworks objects.


Does anyone know of a way to access the solidworks objects in a User Control in C#?