【发布时间】:2021-12-31 15:08:03
【问题描述】:
我想在BodyCollection 中检查我正在使用的主体的主体类型(如果主体是Sphere)。
我该怎么写?
这是我尝试过的:
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();
}
}
}
【问题讨论】: