AnsweredAssumed Answered

Drawing view - How can I get displayed components only?

Question asked by William Cruz on May 9, 2018
Latest reply on May 11, 2018 by Jacob Corder

I have a drawing with multiple views, the assembly that the drawing was created from has some components that are not shown via an extrude-cut feature, they are not hidden or suppressed in the feature tree but they are not visible in the mode view. When I use:

 

swThisView.GetVisibleComponents();

 

It returns everything, all the components even though they are not in the drawing view. This is how I get my drawing views:

 

        internal List<View> swGetAllDwgViews()
        {
            List<View> lstSwViews = new List<View>();
            try
            {
                object[] swAllDwgViews = (_swDwgDoc.GetCurrentSheet()).GetViews() as object[];


                if (swAllDwgViews != null)
                {
                    foreach (View swDwgView in swAllDwgViews)
                    {
                        lstSwViews.Add(swDwgView);
                    }
                }


                return lstSwViews;
            }
            catch (Exception ex)
            {
                return lstSwViews;
            }
        }

 

I've tried going directly to the RootComponent of the drawing view and processing it that way but I still get all the components, including those hidden by the extrude cut feature.

Outcomes