1 Reply Latest reply on Apr 27, 2018 10:11 PM by Amen Allah Jlili

    Show certain hidden parts from a drawing view.

    David Dewey

      I have a view that I am trying to auto balloon. In order for auto balloon to work properly in ballooning hidden components, my view has a cover component hidden. This filename will be unique each time but it will contain a certain text string every time. The drawing view itself is named Drawing View2.


      I have a master drawing that I'm doing a Pack and go from, running auto balloon and then hoping to have this macro to show that cover component in the drawing again.


      If anyone can point me in the right direction of where to start I would appreciate it!

        • Re: Show certain hidden parts from a drawing view.
          Amen Allah Jlili

          The IView interface has two interesting properties:


          ReferencedConfiguration which returns the name of the referenced configuration
          ReferencedDocument which returns an IModelDoc2 object for the referenced document (in your case, that's an assembly)


          Using both of these, you will be to get the referenced configuration (IConfiguration).


          Traverse the IConfiguration components by looking at this example: 2015 SOLIDWORKS API Help - Traverse Assembly at Component Level Example (VBA)


          When traversing the components, use GetPathName to get the pathname of the Component. If the component matches that your filename then set its visibility.


          Using the filename as an approach to find and hide a component is OK as long as you want to hide all instances of all components with that pathname. You'll start having problems when you just want to hide a particular instance.