|
发表于 2016-10-20 20:11:12
|
显示全部楼层
我是用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[0];
//取第一條刀路後,抓到刀具
Tool tool = (Tool) operation.getParent(nxopen.cam.CAMSetup.View.MACHINE_TOOL);
//抓到刀具名稱
val toolName = tool.name(); |
|