void DZWEIZHI::OpenMain()//主入口
{
try
{
//---- Enter your callback code here -----
NXOpen::Session *theSession = NXOpen::Session::GetSession();
NXOpen::Part *workPart(theSession->Parts()->Work());
NXOpen::Part *displayPart(theSession->Parts()->Display());
//获取切换开关的值
PropertyList *blocktoggle01Pros = toggle01->GetProperties();
int theblocktoggle01 = blocktoggle01Pros->GetLogical("Value");
delete blocktoggle01Pros;
blocktoggle01Pros = NULL;
workPart->WCS()->SetVisibility(false);
DingzhenWeizhi();//顶针位置
//if (theblocktoggle01 == 1)
//{
workPart->WCS()->Rotate(NXOpen::WCS::AxisYAxis, 180.0);
for (size_t i = 0; i < vecPersonT.size(); i++)
{
double note_origin[3];
note_origin[0] = vecPersonT[i].M_DX;
note_origin[1] = vecPersonT[i].M_DY;
note_origin[2] = vecPersonT[i].M_DZ;
CreaTxt(vecPersonT[i].strNUMBER, note_origin);//创建TXT文字
CreaExtrude(vecPersonT[i].strNUMBER, note_origin, vecPersonT[i].M_DTAG);//创建拉伸
}
workPart->WCS()->Rotate(NXOpen::WCS::AxisYAxis, 180.0);
//}
workPart->WCS()->SetVisibility(true);
RemoveParam();//去参
Dele();//删除对象
}
catch (exception& ex)
{
//---- Enter your exception handling code here -----
DZWEIZHI::theUI->NXMessageBox()->Show("主入口", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}