New View3D - visible categorys

New View3D - visible categorys

Anonymous
Not applicable
569 Views
4 Replies
Message 1 of 5

New View3D - visible categorys

Anonymous
Not applicable

I'm creating a new 3D view. I want to only have a select few categorys visable. The setVisable parameter true/false would mean I would have to itterate through all of the categorys. Is there a way to start with all categorys off by default? Thanks.

0 Likes
570 Views
4 Replies
Replies (4)
Message 2 of 5

Joe.Ye
Alumni
Alumni

 

Hi bthatcher,

 

Not quite sure I got the point. 

Did you mean to make all element invisible first? Or do you want to get the list of all visible elements' category?

 

If It is the first one, you can get all visible elements via the constructor of FilteredElementCollector class. FitlterElementCollector(viewId, true)

to retrieve all the visiable elements. 

And then hide all these elements via View.Hide(Elementset)

 

If you want to get the list of all visible categories, there is no exposed API to this so far.

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 5

Anonymous
Not applicable

I would like to create a 3Dview with all categories off regardless of element visibility. When I iterate through them manually I'm running into problems with some categories, like Cameras. When I create the new view, I can turn on the categories I'm interested in. I've tried creating a template, but it's not clear if I'm actually using it. How can I accomplish this? Thank you!

0 Likes
Message 4 of 5

Joe.Ye
Alumni
Alumni

 

 

Excuse me, still not quite clear what are you doing and what the problem.

Does this mean that when you try to show the category of Cameras, error occurs?  And what doesn "it's not clear if I'm actually using it?

What does "I've tried creating a template" mean? Is it a view template? or something else?

Thanks for your clarification.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 5 of 5

Anonymous
Not applicable

I am trying to create a new 3D view with all categories off. After creating the 3D view, I've tried turning all of the categories off with...

 

foreach (Category category in categorys)
                {
                    doc.ActiveView.setVisibility(category, false);
                }

 But when it gets to some catgories, Cameras for example, I get the attached error.

 

I have also tried creating a view template, with all categories off,  and assigning it when creating the view. All of the viewtemplateid's appear to be '-1'.  How can I acomplish this? Thank you.

0 Likes