Cancel
Showing results for 
Search instead for 
Did you mean: 

User Attributes for NXOpen:.CAE object - NXOpen C++ API

Valued Contributor
Valued Contributor

Dear All,

 

I am using the NX Open API for NX10 and NX11 under Windows 7. Currently I try to add cutom information to a NXOpen::CAE:: SimSolution object via

auto theSession = NXOpen::Session::GetSession();
auto sim_part = dynamic_cast<NXOpen::CAE::SimPart*>(MOR_OutputGroup::theSession->Parts()->BaseWork());

std::vector<NXOpen::NXObject*> vec = { sim_part->Simulation()->ActiveSolution()};
auto builder = theSession->AttributeManager()->CreateAttributePropertiesBuilder(sim_part, vec, NXOpen::AttributePropertiesBuilder::OperationType::OperationTypeNone);
builder->SetBooleanValue(NXOpen::AttributePropertiesBaseBuilder::BooleanValueOptions::BooleanValueOptionsFalse);
builder->SetTitle(sensor_name_new_);
builder->SetAttributeObjects(vec);
builder->CreateAttribute();
builder->Commit();
builder->Destroy();

However this does not work and received in the NX log file the messages

+++ User attributes are not supported by UGS::CaeSim::LbcFolder

and

Functionality attempted not possible in the current version of the OM

For me it would be prefereable to store the custo information inside the sim file and not in an extra own data file. I also tried to manipulate the ProperyTable but I did not found any "addAttribute" method.

 

Is there any mehod to store custom information in a NXOpen::CAE:: SimSolution object or in a sim file such that it can be assocciated to a SimSolution object?

 

Best,

 

Matthias

4 REPLIES 4

Re: User Attributes for NXOpen:.CAE object - NXOpen C++ API

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

What if you add the attributes to the sim file itself, rather than to the solution object?

Re: User Attributes for NXOpen:.CAE object - NXOpen C++ API

Valued Contributor
Valued Contributor

Hi cowski1,

 

This is of course possible but in my case the user defines the custom objects (a C++ class from my own code base) once and then the string identifiers of these objects are assigned to SimSolutions. This means that every solution has its own (sub)set of assigned custom objects. If I store the string identifiers in user attributes on the sim file I have to manage also the mapping to which SimSolutions they are assigned. This is why it would be more comfortable to operate directly on the SimSolutions.

 

But yes, going with the sim file would be the fallback plan. Thanks for your reply.

 

Best,

 

Matthias 

Re: User Attributes for NXOpen:.CAE object - NXOpen C++ API

Valued Contributor
Valued Contributor

Since there seems to be no solution for adding user attributes to NXOpen::CAE:: SimSolution objects directly, I accept the answer from cowsk1.

 

Nevertheless I would highly appreciate general comments on the NXOpen API policy for which objects user attributes can be used and for which not.

 

Best,

 

Matthias

Re: User Attributes for NXOpen:.CAE object - NXOpen C++ API

Valued Contributor
Valued Contributor

I have encountered very similar difficulties while trying to SetUserAttribute to the Mesh Collectors and Physical Material Properties (in order , say, to add the allowed stress data for further result manipulation). 

 

It would be really great if someone made clear: for exactly which CAE entities can user attributes be created. Because according to the API Reference - this method supposed to work for all NXObject cubclasses but it evidently doesn't.