Marcoantoniosilva
Industrial
- Sep 22, 2013
- 6
Hello everyone.
I've been searching some sample codes that can provide examples about drpos, dpud, udop functions, used to create custom toolpaths in siemens NX. I need a code that provide information about use of selected geometries used to create reference for the toolpath which will be created. Follow a code that i created on java to use DPUD function, but i found some problemns, like a infinity loop on generate the operation. Someone can help me?
I've been searching some sample codes that can provide examples about drpos, dpud, udop functions, used to create custom toolpaths in siemens NX. I need a code that provide information about use of selected geometries used to create reference for the toolpath which will be created. Follow a code that i created on java to use DPUD function, but i found some problemns, like a infinity loop on generate the operation. Someone can help me?
Code:
public static int dpud(String[] args) throws Exception, NXException {
int retorno=0;
initvar();
UFVariant udpud;
UFVariant operptr;
UFVariant udrpos1, udrpos2, udrpos0;
UFDpud.Purpose purpose;
String opname;
UFVariant pathptr;
Tag operacao = null;
udpud = theufsession.dpud().askDpud(null);
operptr = theufsession.dpud().askOper(udpud);
purpose = theufsession.dpud().askPurpose(udpud);
opname = theufsession.oper().askName(operptr);
pathptr = theufsession.oper().askPath(operptr);
operacao = theufsession.obj().cycleByName(opname, operacao);
//udrpos0 = theufsession.dpud().askDrpos0(udpud);
//udrpos1 = theufsession.dpud().askDrpos1(udpud);
//udrpos2 = theufsession.dpud().askDrpos2(udpud);
if (purpose == UFDpud.Purpose.USER_PARAMS) {
theufsession.ui().openListingWindow();
theufsession.ui().writeListingWindow("USER PARAMS" + "\n");
theufsession.ui().writeListingWindow("NOME DA OPERACAO: " + opname + "\n");
theufsession.ui().writeListingWindow("TAG NUMBER : " + operacao + "\n");
theufsession.ui().writeListingWindow("TAG NAME : " + theufsession.obj().askName(operacao) + "\n");
purposeopen();
} else {
theufsession.ui().openListingWindow();
theufsession.ui().writeListingWindow("generate drpos" + "\n");
//retorno = -1;
}
/*
if (purpose == UFDpud.Purpose.REWIND) {
theufsession.ui().openListingWindow();
theufsession.ui().writeListingWindow("REWIND" + "\n");
}
if (purpose == UFDpud.Purpose.STOP_PROCESSOR) {
theufsession.ui().openListingWindow();
theufsession.ui().writeListingWindow("PAROU A DO PROCESSAMENTO" + "\n");
}
if (purpose == UFDpud.Purpose.TAXIS_PARAMS) {
theufsession.ui().openListingWindow();
theufsession.ui().writeListingWindow("TAXIS PARAMETERS" + "\n");
}
if (purpose == UFDpud.Purpose.PROJ_PARAMS) {
theufsession.ui().openListingWindow();
theufsession.ui().writeListingWindow("PROJ PARAMS" + "\n");
}
if (purpose == UFDpud.Purpose.INIT_PROCESSOR) {
theufsession.ui().openListingWindow();
theufsession.ui().writeListingWindow("INIT PROCESSOR" + "\n");
//theufsession.param().generate(operacao);
theufsession.ui().writeListingWindow("GERADO COM SUCESSO" + "\n");
}
//*/
return retorno;
}