How to change visibility setting.

How to change visibility setting.

Anonymous
Not applicable
1,412 Views
2 Replies
Message 1 of 3

How to change visibility setting.

Anonymous
Not applicable

2015-03-03_021018.jpg

 

This is a lighting fixture family file. How can I uncheck "HOST" using API?  

 

Thanks!

0 Likes
Accepted solutions (2)
1,413 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Kukuzry,

 

I am guessing here...

 

Is this what you are after?

 

  /// <summary>
  /// Hide the LightingFixtures category 
  /// Hosts subcategory in the given view.
  /// </summary>
  void HideLightingFixtureHosts( View view )
  {
    Document doc = view.Document;

    Categories categories = doc.Settings.Categories;

    Category catLightingFixtures 
      = categories.get_Item( 
        BuiltInCategory.OST_LightingFixtures );

    CategoryNameMap subcats 
      = catLightingFixtures.SubCategories;

    Category catHosts = subcats.get_Item( "Hosts" );

    view.SetVisibility( catHosts, false );
  }

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Kukuzry,

 

Well thank God we finally got that one nailed down.

 

I added the method implementation to The Building Coder samples:

 

https://github.com/jeremytammik/the_building_coder_samples

 

In release 2015.0.119.1:

 

https://github.com/jeremytammik/the_building_coder_samples/releases/tag/2015.0.119.1

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder