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: 

ModelItems selected in view, not tree

1 REPLY 1
Reply
Message 1 of 2
bthatcher
402 Views, 1 Reply

ModelItems selected in view, not tree

I'm trying to hide a ModeltemCollection. I create the collection and select it. All of the modelitems are highlighted in the view, bit not the Selection Tree. I'm creating the modelitemcollection from a selected item.

 

                foreach (ModelItem item in Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectedItems)
               
                {
                    if (item.AncestorsAndSelf != null)
                        visible.AddRange(item.AncestorsAndSelf);
                    if (item.Descendants != null)
                        visible.AddRange(item.Descendants);
                }

 How can I get them selected in the Tree? Thanks. 

1 REPLY 1
Message 2 of 2
xiaodong_liang
in reply to: bthatcher

Hi,

 

if you call doc.CurrentSelection.CopyFrom(items); I think the items in the selection tree will also be selected. The code you provided is just to filter the items you want to hide. It does not tell how you selected the items. Could you elaborate your question?

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

Post to forums  

Rail Community


Autodesk Design & Make Report