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:
After running the sample code:
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.