string operName = "FACE_MILLING";
NXOpen.CAM.Operation operation1 = (NXOpen.CAM.Operation)workPart.CAMSetup.CAMOperationCollection.FindObject(operName);
int count;
IntPtr[] boundaries;
theUfSession.Cambnd.AskBoundaries(operation1.Tag, CamGeomType.CamBlank, out count, out boundaries);
//theUfSession.Camgeom.AskItems(operation1.Tag, CamGeomType.CamTrim, out count, out boundaries);
theSession.LogFile.WriteLine("boundary count: " + count);
for (int i = 0; i < count; i++)
{
//theUfSession.Camgeom.AskItemEntity(boundaries[i], out entityTag);
//NXObject obj = (NXObject)NXObjectManager.Get(entityTag);
//ShowInfo(obj.Name);
UFCambnd.BoundaryData boundaryData;
theUfSession.Cambnd.AskBoundaryData(boundaries[i], out boundaryData);
int itemsCount;
IntPtr[] items;
theUfSession.Cambnd.AskBoundaryItems(boundaries[i],out itemsCount,out items);
for (int j = 0; j < itemsCount; j++)
{
Tag entityTag;
theUfSession.Cambnd.AskItemEntity(items[j],out entityTag);
theUfSession.Disp.SetHighlight(entityTag, 1);
}
theSession.LogFile.WriteLine("boundaryData.boundary_type: " + boundaryData.boundary_type);
}