怡宁塑胶模具设计

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

//遍历
PartCollection* Pc = theSession->Parts();
for (PartCollection::iterator ite = Pc->begin(); ite != Pc->end(); ite++)
{
NXOpen::BasePart* basePartPtr = (*ite); // 假设这是你的BasePart对象指针
NXOpen::Part* part = dynamic_cast<NXOpen::Part*>(basePartPtr);
if (part != nullptr)
{
// 转换成功,现在可以安全地使用part
//theSession->ListingWindow()->WriteLine("转换成功,现在可以安全地使用" );
NXString ALLpartfullpath = part->FullPath();
//theSession->ListingWindow()->WriteLine("部件路径:"+ALLpartfullpath);
ALLPartNameVector.push_back(ALLpartfullpath.GetLocaleText());
}
else {
// 转换失败,basePartPtr不是Part类型
theSession->ListingWindow()->WriteLine("转换失败,basePartPtr不是Part类型" );
}
}

posted on 2024-07-24 16:08  怡宁塑胶模具设计  阅读(6)  评论(0编辑  收藏  举报