NXOPEN设置属性
作者:互联网
void twb_xd_std::set_attr( std::vector<NXOpen::NXObject *> objects , string attr_category, string attr_title , string attr_value )
{ NXOpen::Session *theSession = NXOpen::Session::GetSession(); NXOpen::Part *workPart(theSession->Parts()->Work()); NXOpen::Part *displayPart(theSession->Parts()->Display()); NXOpen::AttributePropertiesBuilder *attributePropertiesBuilder1; attributePropertiesBuilder1 = theSession->AttributeManager()->CreateAttributePropertiesBuilder(workPart, objects, NXOpen::AttributePropertiesBuilder::OperationTypeNone); //设置属性 attributePropertiesBuilder1->SetCategory(attr_category.c_str());//类别 attributePropertiesBuilder1->SetTitle(attr_title.c_str());//标题 attributePropertiesBuilder1->SetStringValue(attr_value.c_str());//值 attributePropertiesBuilder1->Commit();//执行 attributePropertiesBuilder1->Destroy();//销毁 }标签:attr,attributePropertiesBuilder1,theSession,NXOpen,str,设置,NXOPEN,string,属性 来源: https://www.cnblogs.com/nx10/p/14898107.html