8 Replies Latest reply on Aug 14, 2013 8:03 PM by Anshul Pandeys

    View GetvisibleComponents null

    Anshul Pandeys

      Dear all,


      I am trying to find the components that are visible in the view and its random in the results.I have tied few things for ex getting the view via modeldoc2 and also getting the view via DrawingDoc . Both these case are resulting in  null arrays as shown below. What is that i am missing here ?


                  DrawingDoc swDrawDoc = null;

                  if (modelDoc.GetType() == (int)swDocumentTypes_e.swDocDRAWING)


                      swDrawDoc = modelDoc as DrawingDoc;



                  SolidWorks.Interop.sldworks.View swView = SWDrawingUtils.GetActivatedView(ref modelDoc, _viewName);

                  SolidWorks.Interop.sldworks.View swView3 =  swDrawDoc.GetViewWithName(_viewName);


                  object[] vDrawChildCompArr = swView.GetVisibleComponents();

                  object[] vDrawChildCompArr3 = swView3.GetVisibleComponents();