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

ProSolidMassPropertyGet CSYS Parameter

Highlighted
Regular Member

ProSolidMassPropertyGet CSYS Parameter

Hey Buds,
When passing the name of a csys to ProSolidMassPropertyGet that is not
directly owned by the specified solid, the function returns
PRO_TK_E_NOT_FOUND. For example, I pass the solid handle of a child part
and pass the name of a csys that is created in the parent assembly. My
question is: Does this function require that the csys specified be owned
by the specified solid? This behavior does not happen in the Pro/ENGINEER
command Analysis->Model->Mass Properties.

Is ProE always calculating the mass props of the entire assembly?

Patrick Williams
Sr. Systems Engineer II
Mechanical Engineering Solutions
Missile Systems
Raytheon Company

+1 520.545.6995 (business)
+1 520.545.6399 (fax)
-

TU/M12/8
6221 S Palo Verde Rd
Tucson, AZ 85706 USA
www.raytheon.com



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.
2 REPLIES 2

RE: ProSolidMassPropertyGet CSYS Parameter


> ... My question is: Does this function require that the csys
> specified be owned by the specified solid? This behavior does
> not happen in the Pro/ENGINEER command Analysis->Model->Mass
> Properties.

I think the ProSolid that is passed into this function
determines the context of the analysis.

If it's a part, then it would be as if you had a single part
open in Pro/Engineer and ran the analysis. In this case,
even in normal Pro/Engineer, i don't think you can
reference a CSYS from another model.

It seems that there's a couple different ways to go about
what you're trying to do:

1) Create a simplified rep in the assembly showing only
this part, using a CSYS from the assembly.

2) Figure out the transform matrix between the part default
CSYS and the assembly CSYS, create a new CSYS in the part
using that transform, then run the analysis using that CSYS.

3) Using the transform matrix from option #2, tranform the
results of using the part's default csys.


Hopefully one of these options will work for you.


Marc
--
Marc Mettes
-
Visit My CAD/PDM AutomationBlog
Or, Subscribe to My CAD/PDM Automation Blog by Email





RE: ProSolidMassPropertyGet CSYS Parameter

Hi all,

Patric,

Here is a code snippet to get mass properties in the selected coordinate system

(writing from memory, don't have a user guide near by, check spelling,error checks are ommitted)

ProSelect( "csys",1, NULL,NULL,NULL,NULL, &p_sel,&n_sel);

ProSelectionModelitemGet( p_sel[0], &csys_gi);

ProSelectionAsmcomppathGet( p_sel[0], &cpath_csys);

ProGeomitemGeomitemdataGet( &csys_gi,&p_gd);

//gettransformation matrix from the coordinate system to thecsys owner model

ProMatrixInit( p_gd->p_csys_data->x_v, p_gd->p_csys_data->y_v, p_gd->p_csys_data->z_v, p_gd->p_csys_data->origin, from_csys_trf);

//invert matrix to get transformation from global to local

UserMatrixInvert( from_csys_trf, to_csys_trf);

//get transfromation from the assembly to the owner of the csys, or init identity matrix if csys belongs to assembly

ProAsmcomppathTrfGet( &cpath_csys, PRO_B_FALSE, asm2csysowner_trf);

//multiply matrix to get combined transformation from assembly global frame to the selected csys

UserMatrixMultiply( result_trf, to_csys_trf, asm2csysowner_trf); //check an order of arguments...

//select part andget transfromation matrix from part to assembly frame

ProSelect( "part",1, NULL,NULL,NULL,NULL, &p_sel,&n_sel);

ProSelectionAsmcomppathGet( p_sel{0], &cpath);

ProAsmcomppathTrfGet( &cpath, PRO_B_TRUE, part2asm_trf);

ProAsmcomppathMdlGet( &cpath, &part);

//multiply combined matrix with part matrix to get a final transformation

UserMatrixMultiply( final_trf, result_trf, part2asm_trf);

//get mass properties

ProSolidMassPropertyGet( part, NULL, &prop);

//use ProPointTrfEval to transfer point properties and ProVectorTrfEval for vector entities

//center of gravity:

ProPointTrfEval( prop->center_of_gravity, final_trf, cntr_grav);

and so on...

HIH.

Feliks.