NX 如何获取某个程序所用的刀具?
假如说有一个程序:KC-1,怎么获取这个程序所用的刀具?我是用java
以前出程序單也是自己寫外掛
以下憑記憶,寫個大概,可能有誤,請勿見怪
Session theSession = (Session) SessionFactory.get("Session");
Part workPart = theSession.parts().work();
NCGroup findObject = workPart.camsetup().camgroupCollection().findObject(參數為你的程序);
//findObject的參數可為複數程序,都用同一支刀
CAMObject[] members = findObject.getMembers();
//既然都用同一支刀,我就只取程序第一條刀路
Operation operation = (Operation) members;
//取第一條刀路後,抓到刀具
Tool tool = (Tool) operation.getParent(nxopen.cam.CAMSetup.View.MACHINE_TOOL);
//抓到刀具名稱
val toolName = tool.name(); NXOpen哪个函数? qaed 发表于 2016-10-20 20:11
我是用java
以前出程序單也是自己寫外掛
以下憑記憶,寫個大概,可能有誤,請勿見怪
好的,谢谢了,抽空我试一下{:smile:}
页:
[1]