Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select all displayed item

2 REPLIES 2
Reply
Message 1 of 3
JohnHon
941 Views, 2 Replies

Select all displayed item

Dear all,

 

In API, is there any method that we can use to select all items that is displayed?

P.s. There are items whose isHidden field are 'False', but they are not displayed because of the parent.

 

If not, can we create a selection box area by API, so that we can select all displayed items?

 

Thanks,

John

2 REPLIES 2
Message 2 of 3
xiaodong_liang
in reply to: JohnHon

Hi John,

checking isHidden is what I can think of, but probably what frustrated you is actually you did not like to iterate the model hierarchy? If yes, you could use

IEnumerable<ModelItem> items = doc.Models.First.RootItem.Descendants.
Where(x => !x.isHidden);

of course, you can select the items within a boundingbox. e.g.

IEnumerable<ModelItem> items = doc.Models.First.RootItem.Descendants.
Where(x => !x.isHidden && YourSelectionBox.Contains(x.BoundingBox));

Message 3 of 3
JohnHon
in reply to: xiaodong_liang

Hi Xiaodung,

 

Thanks for replyine me again.

 

Actually, I don't want to get all non hidden items.

I just want to get those model items similar to the one using selection box tool.

It provides us only the items that is displayed without their descendant and ancestors.

 

is it possible to get those items?

 

Thanks,

John

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report