Need Help-How to change Model Tree hierarchy of Navisworks ?

Need Help-How to change Model Tree hierarchy of Navisworks ?

piyinghai
Observer Observer
480 Views
4 Replies
Message 1 of 5

Need Help-How to change Model Tree hierarchy of Navisworks ?

piyinghai
Observer
Observer

I imported my files from Revit into Navisworks. The selected tree structure is fixed and cannot be changed.I try to change porperty.Value , But not modifiable.I need to render the selection tree of Navisworks based on the data I entered in Revit. 

 

1.png

  I've seen someone implement choice tree structural refactoring as below:

2.png

 But I don't know how to do that.like below

3.png

 

Please help me. Best wish !

 

0 Likes
481 Views
4 Replies
Replies (4)
Message 2 of 5

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @piyinghai ,

 

To the best of my knowledge, it is not possible to modify the Model Tree hierarchy in Navisworks. However, you can sort the existing Model Tree hierarchy or create a custom selection tree.

 

Please refer to the following links for more information:

 

https://adndevblog.typepad.com/aec/2013/04/use-navisworks-api-with-wpf-binding-model-hierarchy-to-tr...

 

https://forums.autodesk.com/t5/navisworks-api/sort-navisworks-model-tree-through-commandline/td-p/12...


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

piyinghai
Observer
Observer

Thanks for your reply, I need to have a try. Before that, I would like to ask if the results achieved by this article are as follows, is it the result under the standard mode of Navisworks' selection tree?

Result.png

0 Likes
Message 4 of 5

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @piyinghai ,

 

In your previous post, the attached image shows that I simply selected the standard mode and sorted the selection tree in ascending alphabetical order.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

peter_hirn
Enthusiast
Enthusiast

Leaving this info here for future victims readers.

 

It's not possible to change the hierarchy directly. The best workaround I could find:

 

- Navisworks addin starts external process (ie. worker.exe) and establishes IPC (this is required as calling NwCreate directly from the addin is not possible, see https://adndevblog.typepad.com/aec/2012/05/nwcreate-with-net-plug-in.html)
- Addin reads structure, properties and raw geometry (vertices, normals, transforms) from model (see https://adndevblog.typepad.com/aec/2012/05/get-primitive-from-solid-of-navisworks.html)
- Addin transfers data via IPC to worker.exe
- worker.exe creates a Navisworks document from scratch using NwCreate and reassembles structure, geometry, properties

 

If you want to write your worker in C# you have to create your own bindings for `nwcreate.dll`, eg. https://gist.github.com/peterhirn/9c241386aecbf45de59256314c2a6372

 

OTOH the .NET COM interop performance is not great, so I'm now considering rewriting everything in C++, see https://adndevblog.typepad.com/aec/2018/09/get-primitive-from-solid-of-navisworks-by-native-com.html

 

🤷

0 Likes