Depth first search for geometry below this item in hierarchy
Namespace: Autodesk.Navisworks.Api
Assembly: Autodesk.Navisworks.Api (in Autodesk.Navisworks.Api.dll)
Syntax
Return Value
First geometry or null if none found
Examples
CopyOutputing Geometry
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Forms;
using System.Text;
using Autodesk.Navisworks.Api.Controls;
static public void OutputFirstGeometry()
{
try
{
if (Autodesk.Navisworks.Api.Application.ActiveDocument != null &&
!Autodesk.Navisworks.Api.Application.ActiveDocument.IsClear)
{
ModelGeometry first =
Autodesk.Navisworks.Api.Application.ActiveDocument.
Models[0].RootItem.FindFirstGeometry();
if (first != null)
{
string text = string.Empty;
text = string.Format("ActiveColor = {0}" +
"\nActiveTransparency = {1}" +
"\nBoundingBox = {2}" +
"\nFragmentCount {3}" +
"\nIsSolid {4}" +
"\nItem {5}" +
"\nOriginalColor {6}" +
"\nOriginalTransparency {7}" +
"\nPermanentColor {8}" +
"\nPermanentTransparency {9}",
first.ActiveColor.ToString(),
first.ActiveTransparency,
first.BoundingBox.ToString(),
first.FragmentCount,
first.IsSolid.ToString(),
first.Item.ToString(),
first.OriginalColor.ToString(),
first.OriginalTransparency,
first.PermanentColor.ToString(),
first.PermanentTransparency);
MessageBox.Show(text);
}
}
}
catch (Exception e)
{
MessageBox.Show(e.Message + "\n\n" + e.ToString());
}
}
Exceptions
See Also