UG NX二次开发源码分享:NX manager环境下保存新的版本
UG NX二次开发源码分享:NX manager环境下保存新的版本
使用NewPartFromPartBuilder()类可以保存一个新的item revision。
static void do_it(void)
{
Session *theSession = Session::GetSession();
try
{
Session *theSession = Session::GetSession();
tag_t
tagWorkPart = NULL_TAG;
char
PartName = {""},
PNum = {""},
part_revision = {""},
Ptype = {""},
part_file_name = {""};
NXOpen::NXString strrev;
tagWorkPart = UF_PART_ask_display_part();
UF_PART_ask_part_name(tagWorkPart, PartName );
UF_UGMGR_decode_part_filename(PartName,PNum, part_revision, Ptype, part_file_name);
PDM::PartFromPartBuilder *partFromPartBuilder1;
partFromPartBuilder1 = theSession->Parts()->PDMPartManager()->NewPartFromPartBuilder();
partFromPartBuilder1->CreatePartSpec("Part", PNum, NULL, Ptype, part_file_name);
strrev = partFromPartBuilder1->AssignPartRevision();
partFromPartBuilder1->Commit();
delete partFromPartBuilder1;
}
catch (const std::exception& ex)
{
/* your exception handling code goes here */
}
}
学习了,高手
页:
[1]