Navisworks API

Reply
Distinguished Contributor
Posts: 716
Registered: ‎12-12-2003
Message 1 of 2 (146 Views)

ModelItems selected in view, not tree

146 Views, 1 Replies
01-16-2013 12:40 PM

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. 

ADN Support Specialist
xiaodong.liang
Posts: 1,197
Registered: ‎06-12-2011
Message 2 of 2 (129 Views)

Re: ModelItems selected in view, not tree

01-23-2013 06:02 PM 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?



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community