Navisworks

Setting multiple PrimitiveTypes for Clash Testing via Navisworks API

By Naveen Kumar

I'd like to delve into a specific aspect of clash testing: setting multiple PrimitiveTypes via Navisworks API. When dealing with clash testing in Navisworks, the ability to specify PrimitiveTypes for clash detection can significantly enhance the accuracy and relevance of clash results. By defining which geometric primitives (such as triangles, lines, or points) should be considered during clash tests, users can tailor the analysis to suit their specific project requirements.

Here's a simple code snippet demonstrating how to set multiple PrimitiveTypes for clash testing using Navisworks API:

Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
DocumentClash documentClash = doc.GetClash();
DocumentClashTests oDCT = documentClash.TestsData;
ClashTest t = oDCT.Tests[0] as ClashTest;
ClashTest oCopyt = t.CreateCopy() as ClashTest;
oCopyt.SelectionA.PrimitiveTypes = PrimitiveTypes.Triangles | PrimitiveTypes.Lines;
oCopyt.SelectionB.PrimitiveTypes = PrimitiveTypes.Lines | PrimitiveTypes.Points;
oDCT.TestsEditTestFromCopy(t, oCopyt);

Before running the sample code:

Before


After running the sample code:

After


If you're new to the Clash Detection API, my colleague Xiaodong has crafted an extensive guide on leveraging its capabilities. These resources offer valuable insights for optimizing clash detection workflows in Autodesk Navisworks.

I encourage you to explore the links provided below.

https://adndevblog.typepad.com/aec/2012/05/navisworks-net-api-2013-new-feature-clash-1.html

https://adndevblog.typepad.com/aec/2012/05/navisworks-net-api-2013-new-feature-clash-2.html

In addition, the Navisworks SDK includes helpful samples specifically focusing on clash detection. To explore these samples, go to 'NET\examples\PlugIns\ClashDetective' in the Navisworks SDK.

 


06/13/2023

10/03/2022

05/04/2022

04/06/2021

04/20/2020

07/28/2019

09/30/2018

07/01/2018

03/29/2017

04/11/2016

April 2024

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

Autodesk Blogs

Share