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

2 REPLIES 2
Reply
Message 1 of 3
SergioFA
995 Views, 2 Replies

Select all

Hi all

 

Please, how can i trigger the "Select All" button from my app using c#.

 

Thanks,

 

Regards,

SF

Tags (2)
2 REPLIES 2
Message 2 of 3
xiaodong_liang
in reply to: SergioFA

Hi,

 

no API to call any built-in commands. But API provides direct way to select all.

 

.NET:  DocumentCurrentSelection.SelectAll()

 

COM: State.CurrentSelection.SelectAll()

Message 3 of 3

My SelectAll only selects one object.

 

How can I select "all" objects in NV?

 

This line provides nothing of value:

 

  Autodesk.Navisworks.Api.Application.ActiveDocument.CurrentSelection.SelectAll();

 

This line provides only one object in the list:

 

  MainDoc = Autodesk.Navisworks.Api.Application.MainDocument;

  MainDoc.CurrentSelection.SelectAll();

 

 

 

I'm trying to make a list of all objects.  maybe there is a better way to do this, but "RootItemDescendantsAndSelf" and "Search API" techniques are terribly slow.  The "RootItemDescendantsAndSelf" method keeps cycling back to the original line of code, and loops thru all the geometry even though it has already been assigned to a different array/list.  With 100,000's of objects, this is not possible.  I'd rather just have a list of all the objects once, and I'll use conditionals to channel the code.  

 

0001D LLC. Where Design, Genetics, and Technology Overlap www.0001design.com

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report