I want to check what is the body type of the body I'm working with in a BodyCollection
(If the body is Sphere
).
How do I write that?
This is what I tried:
public void ChamferAll()
{
int subtype = 1;
string offset1 = "5", offset2 = "0", angle = "5";
BodyCollection bodyCollection = theSession.Parts.Work.Bodies;
List<Tag> edgeTags = new List<Tag>();
foreach (Body body in bodyCollection)
{
if (body.GetType() == NXOpen.Features.Sphere)
continue;
else
{
Edge[] edges = body.GetEdges();
foreach (Edge edge in edges)
{
edgeTags.Add(edge.Tag);
theUFSession.Modl.CreateChamfer(subtype, offset1, offset2, angle, edgeTags.ToArray(), out Tag chamferTag);
}
edgeTags.Clear();
}
}
}