cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ProMassPropertyGet() doesn't match Analysis->Mass Properties results.

Highlighted
Regular Member

ProMassPropertyGet() doesn't match Analysis->Mass Properties results.

On each component of an assembly I am calculating mass properties
referencing a csys owned by the top-level assembly. I isolate each
component by creating a simplified representation that only contains the
component. I am finding that when I call ProMassPropertyGet() the results
are not the same as if I created a Mass Properties analysis feature within
Pro/ENGINEER. For example Pro/ENGINEER always reports the mass to be 1.209
lb whereas the results from the API are 0.966. Why is Pro/ENGINEER
calculating a different mass than the API?

Here's the code for the simp rep creation and mass property calculation.

ProError AssemblyComponent::ComputeMassProperties(ProName csysName) {

char *szFuncName =
"AssemblyComponent::ComputeMassProperties()";
int i = 0,
j = 0,
nWindowId
= 0;
ProError pro_error =
PRO_TK_NO_ERROR;
ProMdl pro_mdl = NULL;
ProModelitem pro_modelItem;
ProSimprepdata *pro_simpRepData = NULL;
ProSimprepAction pro_simpRepAction;
ProSimprepitem pro_simpRepItem;
ProSimprep pro_simpRepTemp;

//Determine if this is the top-level
if(m_pro_asmCompPath.table_num != 0) {

//Allocate the simprep data
pro_error = ProSimprepdataAlloc(L"MPRTempRep",
PRO_B_FALSE, PRO_SIMPREP_EXCLUDE, &pro_simpRepData);
PROUTIL_CALL_REPORT("ProSimprepdataAlloc()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Initialize the action
pro_error = ProSimprepActionInit(PRO_SIMPREP_INCLUDE,
NULL, &pro_simpRepAction);
PROUTIL_CALL_REPORT("ProSimprepActionInit()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Get the component model
pro_error = ProAsmcomppathMdlGet(&m_pro_asmCompPath,
&pro_mdl);
PROUTIL_CALL_REPORT("ProAsmcomppathMdlGet()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Get the model item
pro_error = ProMdlToModelitem(pro_mdl, &pro_modelItem);
PROUTIL_CALL_REPORT("ProMdlToModelitem()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Initialize the simp rep data item
pro_error =
ProSimprepdataitemInit(m_pro_asmCompPath.comp_id_table,
m_pro_asmCompPath.table_num, pro_modelItem.id, &pro_simpRepAction,
&pro_simpRepItem);
PROUTIL_CALL_REPORT("ProSimprepdataitemInit()",
szFuncName, pro_error, pro_error!=PRO_TK_NO_ERROR);

//Add the simp rep data item
pro_error = ProSimprepdataitemAdd(pro_simpRepData,
&pro_simpRepItem);
PROUTIL_CALL_REPORT("ProSimprepdataitemAdd()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Create the simp rep
pro_error =
ProSimprepCreate((ProSolid)m_pro_asmCompPath.owner, pro_simpRepData,
&pro_simpRepTemp);
PROUTIL_CALL_REPORT("ProSimprepCreate()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Activate the simp rep
pro_error =
ProSimprepActivate((ProSolid)m_pro_asmCompPath.owner, &pro_simpRepTemp);
PROUTIL_CALL_REPORT("ProSimprepActivate()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Display the simp rep
pro_error =
ProSolidDisplay((ProSolid)m_pro_asmCompPath.owner);
PROUTIL_CALL_REPORT("ProSolidDisplay()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR && pro_error!=PRO_TK_E_FOUND);

//Get the current window id
pro_error = ProWindowCurrentGet(&nWindowId);
PROUTIL_CALL_REPORT("ProWindowCurrentGet()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Refit the window
pro_error = ProWindowRefit(nWindowId);
PROUTIL_CALL_REPORT("ProWindowRefit()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Free the sim rep data
pro_error = ProSimprepdataFree(&pro_simpRepData);
PROUTIL_CALL_REPORT("ProSimprepdataFree()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

pro_error = ProModelitemMdlGet(&pro_simpRepTemp,
&pro_mdl);
PROUTIL_CALL_REPORT("ProModelitemMdlGet()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);
}
else
pro_mdl = m_pro_asmCompPath.owner;

//Calculate the mass properties
pro_error = ProSolidMassPropertyGet((ProSolid)pro_mdl, csysName,
&m_pro_massProperties);
PROUTIL_CALL_REPORT("ProSolidMassPropertyGet()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);

//Switch the sign of the intertia tensor at COG
for(i=0;i<3;i++) {
m_pro_massProperties.cg_inertia_tensor[i][0] *= -1;
m_pro_massProperties.cg_inertia_tensor[i][1] *= -1;
m_pro_massProperties.cg_inertia_tensor[i][2] *= -1;
}

//Determine if this is the top-level
if(m_pro_asmCompPath.table_num != 0) {

//Remove the temp simp rep
pro_error = ProSimprepDelete(&pro_simpRepTemp);
ProUtilCallReport("ProSimprepDelete()", szFuncName,
pro_error, pro_error!=PRO_TK_NO_ERROR);
}

return PRO_TK_NO_ERROR;
}

PATRICK S WILLIAMS
Information Technology
Mechanical Engr Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (office)
+1 520.446.0244 (pager)
+1 520.545.6399 (fax)
-

6221 S Palo Verde Rd
Tucson, AZ 85706-5093 USA
www.raytheon.com

Follow Raytheon On




This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.
1 REPLY 1

ProMassPropertyGet() doesn't match Analysis->Mass Properties results.

Ok, I believe I have found the discrepancy. Pro/TOOLKIT will only report
back the mass properties from an "assigned" point of view whereas the
default for Pro/ENGINEER is "computed". Now I have to figure out how to
get Pro/TOOLKIT to return "computed" values. Here is a screenshot of the
difference. Notice the difference in the values for AVERAGE DENSITY and
MASS.



PATRICK S WILLIAMS
Information Technology
Mechanical Engr Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (office)
+1 520.446.0244 (pager)
+1 520.545.6399 (fax)
-

6221 S Palo Verde Rd
Tucson, AZ 85706-5093 USA
www.raytheon.com

Follow Raytheon On




This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.