UG NX二次開發(C#)-建模-獲得NX當前打開的所有part文件

GimiGimmy 2022-01-07 09:03:15 阅读数:445

ug nx 二次 c# 建模
 public static Part[]GetAllOpenedParts()
{
Part[] parts = new Part[0];
try
{
int partNumber = uFPart.AskNumParts();
int i = 0;
for (i = 0; i < partNumber; i++)
{
Tag tag = uFPart.AskNthPart(i);
NXObjectManager nXObjectManager = new NXObjectManager();
Part part1 = (Part)nXObjectManager.GetTaggedObject(tag);
Array.Resize(ref parts, parts.Length + 1);
parts[parts.Length - 1] = part1;
}
}
catch(Exception ee)
{
UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.Error, ee.Message);
}
return parts;
}

版权声明:本文为[GimiGimmy]所创,转载请带上原文链接,感谢。 https://gsmany.com/2022/01/202201070903154348.html