|
就是要用到自带JA去录制c++写属性的过程,用Assemblies::Component *component1=(Assemblies::Component *)NXObjectManager::Get(obj); 将tag_t obj转成实例化成open c++,就能将前录制的步骤连接起来了
0 ~/ @+ a$ N+ _# JAssemblies::Component *component1=(Assemblies::Component *)NXObjectManager::Get(obj);
* I$ H; ], U! U& s2 j5 r. n9 ] std::vector<NXObject *> objects1(1);
# {/ Q' k. `& z8 {. l objects1[0] = component1;
; r: Q7 X5 |6 p! |: ~' A5 r3 _ AttributePropertiesBuilder *attributePropertiesBuilder1;
1 z* V% [2 a- o- b! p2 I: ]. Y attributePropertiesBuilder1 = workPart->PropertiesManager()->CreateAttributePropertiesBuilder(objects1);0 L8 V- C( g0 U9 }
attributePropertiesBuilder1->SetObjectPicker(AttributePropertiesBaseBuilder::ObjectOptionsComponentInstance);//写入组件
0 q$ d, X7 P6 J9 p; K; V//attributePropertiesBuilder1->SetObjectPicker(AttributePropertiesBaseBuilder::ObjectOptionsComponentAsPartAttribute); //写入部件中( ?5 X3 P) E; p! H
//attributePropertiesBuilder1->SetObjectPicker(AttributePropertiesBaseBuilder::ObjectOptionsOccurrence);//写入装配
+ @. x; V0 I" h6 E9 p6 p* y7 b- Z//下面进行属性值填写
9 e6 D2 Y `( K8 E7 wattributePropertiesBuilder1->SetTitle(“你的标题”);
4 {3 A* i4 c$ b/ Z# P0 S- V attributePropertiesBuilder1->SetStringValue("你的属性值");
7 F/ J- T `7 a NXObject *nXObject2;
/ K, i% {3 A6 r! n4 u, j6 n0 X nXObject2 = attributePropertiesBuilder1->Commit();; m. Y5 U" {. g5 Z
attributePropertiesBuilder1->Destroy(); |
|