Showing results for 
Search instead for 
Do you mean 
Reply

NXOpen C++: how to get the attribute with multiple values

[ Edited ]

Hi, everyone. Recently I am undergoing a project to get the attribute of Routing:: Stock object, for normal attributes, I can reach them by Stocks->GetStockData()->GetStringCharacteristic (const char *name). However, for  attribute with multiple values("test" attribute as shown in the picture), how can I get each value of them?Capture1.PNG

 

 I also tried GetStringUserAttribute (const NXString &title, int index), but it doesn't work.

4 REPLIES

Re: NXOpen C++: how to get the attribute with multiple values

From the NXOpen.Part object you use the method GetUserAttributeAsString(), which is the newly introduced function in NX 8.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: NXOpen C++: how to get the attribute with multiple values

[ Edited ]

I met a very strange thing. The picture 1 is the a defaut attribute which has already existed, the picture 2 is the same attribute modified by myself. The picture 3 is an attribute defined by myself. And I use the following code to read these attribute, the result really confused me. Can find what's the problem?

It shows that it can get the attribute for default attributes, but it returns the same value for multiple value(It seems what I modified doesn't work). And it just can't find the attribute defined by myself.

1.PNG2.PNG3.PNG

Re: NXOpen C++: how to get the attribute with multiple values

What does the syslog tell you about the exception of the last example?

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: NXOpen C++: how to get the attribute with multiple values

It shows the attribute was not found.4.PNG