怡宁塑胶模具设计

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

C++

 

Session *theSession = Session::GetSession();
Part *workPart(theSession->Parts()->Work());
Part *displayPart(theSession->Parts()->Display());

 

//NXOpen对当前工作部件加属性

std::vector<NXObject *> objects1(1);
objects1[0] = workPart;
AttributePropertiesBuilder *attributePropertiesBuilder1;
attributePropertiesBuilder1 = theSession->AttributeManager()->CreateAttributePropertiesBuilder(workPart,
objects1, AttributePropertiesBuilder::OperationTypeNone);
attributePropertiesBuilder1->SetTitle("PartNo");//创建属性标题
attributePropertiesBuilder1->SetStringValue("1-001");//创建字符属性内容

NXObject *nXObject1;
nXObject1 = attributePropertiesBuilder1->Commit();//创建第一个属性

attributePropertiesBuilder1->SetTitle("PartName");//创建属性标题
attributePropertiesBuilder1->SetStringValue("后模仁");//创建字符属性内容

NXObject *nXObject2;
nXObject2 = attributePropertiesBuilder1->Commit();//创建第二个属性

attributePropertiesBuilder1->Destroy();//释放attributePropertiesBuilder1

 

 

posted on 2020-12-23 10:35  怡宁塑胶模具设计  阅读(492)  评论(0编辑  收藏  举报