Get primitive from solid of Navisworks by Native COM

By Xiaodong Liang

It has been known by how to Get primitive from solid of Navisworks. Because there is not native NET API, we will need to take advantage of COM Interop. While COM Interop means managed-native transitions, which will cause lot of the slowness when the model is huge. So geometry extraction should be faster if it is all pure COM code. In another word, some unmanaged COM code could potentially be quicker.

So I tried to make some codes. These are two plugins, one is written  C++/CLI code (by raw COM), another is NET code (by COM Interop). The stats of some sample Navisworks models and one customer specific model.

https://github.com/xiaodongliang/Navisworks-Geometry-Primitives

Model     Geometry Nodes Count Fragments Count Time to Extract Primitive (ms)
ClashTest.nwd 318 840 NET(334)        COM(227)
GateHouse.nwd 1354 2386 NET(688)        COM(412)
One Customer Model 225360 353341 NET(2,186,333)    COM(872,978)

 

The projects are built on Visual Studio 2017 (v15.7.5), Navisworks 2018, Win 10 in Windows Parallel of macOS Sierra version 10.12.6

Note: with pure COM project, build it and execute the button in release mode. This is typical for performance testing. If in debugging mode, it will be extremely slow. 

 


Comments

3 responses to “Get primitive from solid of Navisworks by Native COM”

  1. Hi!
    I share with you this Revit add-in that helps extract data and provides information in an easier way.
    You can download it for free here: http://bit.ly/GetCorbisSniffer
    It is meant to help Revit users and make their processes a lot simpler (and save valuable time!)
    hope you find it useful!

  2. Dear author, thank you for penning down such an informative article that not only clears doubts but also imparts new knowledge.

  3. David Huff Avatar
    David Huff

    Where do I find the documentation for the COM API? I can find the docs for the .NET API but nothing for the COM API.

Leave a Reply to Technostruct LLCCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading