Cancel
Showing results for 
Search instead for 
Did you mean: 

Get volume of a mesh - Use of CAE.SolidPropertyCheckBuilder

Siemens Creator Siemens Creator
Siemens Creator

Hi all, 

 

I'm trying to get the volume of a mesh in a c# NXOpen dll on NX 10. 

 

Interactively, it corresponds to click right on a Mesh, and then Solid Properties and there I can find the volume of the whole mesh. 

 

I got advised to use CAE.SolidPropertyCheckBuilder but I didn't find how to use it properly. 

 

Anyone has an idea on how to initialise it/use it ?

 

Thanks for your help ! 

3 REPLIES

Re: Get volume of a mesh - Use of CAE.SolidPropertyCheckBuilder

Siemens Phenom Siemens Phenom
Siemens Phenom

@Valene,

 

You need to instantiate a SolidPropertyCheckBuilder from the ModelCheckManager.

 

See the attached for an example of your application.

Re: Get volume of a mesh - Use of CAE.SolidPropertyCheckBuilder

Siemens Creator Siemens Creator
Siemens Creator

Sorry for the late reply. 

 

The example helps a lot ! Thanks

Re: Get volume of a mesh - Use of CAE.SolidPropertyCheckBuilder

Siemens Creator Siemens Creator
Siemens Creator

Dear all, 

 

It's been two years, but I'm still using this function. 

I wanted to avoid to parse the output file and I found there's a function GetSolidPropertyValues which seems to correspond to what I want. 

 

I tried to use it but the call to the function crashes without any nice error message.

Here's the code. Does someone has an idea ? 

 

Thank you

SolidPropertyCheckBuilder* checkProp = theFemPart->ModelCheckMgr()->CreateSolidPropertyCheckBuilder();

checkProp->EvaluationTemparature()->SetRightHandSide("0");
checkProp->SetOutputOption(true);

vector<Mesh*> vecMesh;
vecMesh.push_back(mesh);
RelatedElemMethod* elemMethod = theFemPart->SmartSelectionMgr()->CreateRelatedElemMethod(vecMesh, false);

checkProp->Elements()->Selection()->Add(elemMethod);
checkProp->SetUserSpecifiedUnit(SolidPropertyCheckBuilder::UserUnitKgMilli);
checkProp->SetSplitMass(false);
checkProp->SetDisplayCgOption(false);
checkProp->SetDefaultTemperatureOption(true);
checkProp->SetCoupledSolutionOption(SolidPropertyCheckBuilder::CoupledSolutionOutputStructural);

NXObject* res = checkProp->Commit();

std::vector<NXOpen::CAE::SolidPropertyCheckBuilder::ValueRequest> valueTypes;
valueTypes.push_back(NXOpen::CAE::SolidPropertyCheckBuilder::ValueRequestVolume);

std::vector<NXOpen::Unit *> valueUnits;
std::vector<double> values;

checkProp->GetSolidPropertyValues(valueTypes, valueUnits, values);

checkProp->Destroy();