|
就是要用到自带JA去录制c++写属性的过程,用Assemblies::Component *component1=(Assemblies::Component *)NXObjectManager::Get(obj); 将tag_t obj转成实例化成open c++,就能将前录制的步骤连接起来了
L% C9 o9 O) b- v' Y( q- h9 w7 zAssemblies::Component *component1=(Assemblies::Component *)NXObjectManager::Get(obj);
/ I3 c% a0 w2 w1 D Q, S std::vector<NXObject *> objects1(1);
4 I- ]% j5 s4 e; q0 d# p objects1[0] = component1;7 ]' o, V: H! p8 o; w
AttributePropertiesBuilder *attributePropertiesBuilder1;
% Y! y# ^4 t z7 q% q attributePropertiesBuilder1 = workPart->PropertiesManager()->CreateAttributePropertiesBuilder(objects1);
- I+ E$ \8 w* ^: n4 g/ TattributePropertiesBuilder1->SetObjectPicker(AttributePropertiesBaseBuilder::ObjectOptionsComponentInstance);//写入组件
6 s; J; w9 b" p//attributePropertiesBuilder1->SetObjectPicker(AttributePropertiesBaseBuilder::ObjectOptionsComponentAsPartAttribute); //写入部件中" |* V% G. r1 K, }9 x+ k
//attributePropertiesBuilder1->SetObjectPicker(AttributePropertiesBaseBuilder::ObjectOptionsOccurrence);//写入装配( A* L7 y4 w4 X6 T0 m, y U
//下面进行属性值填写5 l' _# A* E5 H1 G/ n
attributePropertiesBuilder1->SetTitle(“你的标题”);
' u0 w9 Y! A' G+ ~ attributePropertiesBuilder1->SetStringValue("你的属性值");
e1 X1 A. }/ l' ~ NXObject *nXObject2;* E( V# M; h. g* ?4 @: K: g: d
nXObject2 = attributePropertiesBuilder1->Commit();$ u- @4 b, O( g S. h2 w8 a
attributePropertiesBuilder1->Destroy(); |
|