首页 > 其他分享 >UF删除实体或者部件属性UF_ATTR_delete_all

UF删除实体或者部件属性UF_ATTR_delete_all

时间:2023-03-10 12:55:50浏览次数:54  
标签:UF ATTR 删除 事例 bodyTAG delete

void SEModifyAttX::delAtt() //删除实体或者部件事例属性
{
try
{
//获取UI界面的属性

//获取选择对象TAG
PropertyList *blockxuanzhePros = bodySelect0->GetProperties();
std::vector<NXOpen::TaggedObject*> theblockxuanzhe = blockxuanzhePros->GetTaggedObjectVector("SelectedObjects");
delete blockxuanzhePros;
blockxuanzhePros = NULL;

UF_initialize();

for (int i = 0; i < theblockxuanzhe.size(); i++)
{
tag_t bodyTAG = theblockxuanzhe[i]->Tag();

if (UF_ASSEM_is_occurrence(bodyTAG))//判断是否为部件事例标识(occurrence)
{

UF_ATTR_delete_all(bodyTAG, UF_ATTR_any); //删除部件事例标识
bodyTAG = UF_ASSEM_ask_prototype_of_occ(bodyTAG); //覆写TAG
UF_ATTR_delete_all(bodyTAG, UF_ATTR_any); //删除对象事例标识

}
else
{
UF_ATTR_delete_all(bodyTAG, UF_ATTR_any); //删除对象事例标识

}

}

UF_MODL_update();

theDialog->PerformApply();

UF_terminate();
}
catch (exception& ex)
{
//---- Enter your exception handling code here -----
SEModifyAttX::theUI->NXMessageBox()->Show("删除实体或者部件事例属性", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}

标签:UF,ATTR,删除,事例,bodyTAG,delete
From: https://www.cnblogs.com/firetuo/p/17203004.html

相关文章