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: 

selection Set, CurrentSelection.SelectedItems

4 REPLIES 4
Reply
Message 1 of 5
Evgueny
1048 Views, 4 Replies

selection Set, CurrentSelection.SelectedItems

dear experts.

I need add set to SelectionA and add set to SelectionB without SelectionA. How can i do this? Help me please.

 

regards. Evgueny;

 

 

(and another: example of Selection Sets from api manual not working. output string contained file name only

screen of manual and screen of testprogram in attachment)

 

 

4 REPLIES 4
Message 2 of 5
Evgueny
in reply to: Evgueny

And method remove not working; For example:
ModelItem setA = doc.CurrentSelection.SelectedItems.First.Parent;
ModelItemCollection setB = new ModelItemCollection();
setB.CopyFrom(doc.Models.RootItems);
setB.Remove(setA);

Why?
Message 3 of 5
xiaodong_liang
in reply to: Evgueny

Hi,

 

you could call ModelItemCollection.Invert to get the inverted selection (which for SelectionB) . Or you could refer to this blog which provides another way. It gets the un-selected items. It is similar to your scenrio. 

http://adndevblog.typepad.com/aec/2012/06/focusing-on-a-selected-item-and-hide-all-others-using-navi...

 

As to the API sample in manual, could you provide a small project for invesigation? does it occur with specific model?

Message 4 of 5
Evgueny
in reply to: xiaodong_liang

In my test program I'm copied-pasted example from api manual and messagebox contained file name only. This problem with all navisworks files.

Message 5 of 5
Evgueny
in reply to: Evgueny

 

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report