From the Vault of PTC, try this, its a tried and true method.
Steve
Suggested Technique for Creating Datum Coordinate System at the Center of Gravity of a Part
--------------------------------------------------------------------------------
The following example will step through the creation of a coordinate system at the center of gravity for any part. A similar technique may also be applied to assemblies.
--------------------------------------------------------------------------------
Procedure
Create a default coordinate system on the part by selecting Datum, Coord Sys, Default, from the INSERT Drop Down Menu. Note: Any type of coordinate system may be created.
Calculate mass properties for the part by selecting Model Analysis from Analysis Drop Down menu and Model Mass Properties from the Type Input Panel. Accept the default relative accuracy of 1.0000e-05 and select the coordinate system created in step 1 above. For this example, the following information is displayed:
MASS PROPERTIES OF THE PART
VOLUME = 2.3775283e+01 INCH^3
SURFACE AREA = 4.9949963e+01 INCH^2
DENSITY = 1.0000000e+00 POUND / INCH^3
MASS = 2.3775283e+01 POUND
CENTER OF GRAVITY with respect to CS0 coordinate frame:
X Y Z 0.0000000e+00 0.0000000e+00 2.4544557e+00 INCH
....
ROTATION ANGLES from CS0 orientation to PRINCIPAL AXES (degrees):
angles about x y z -90.000 0.000 -90.000
RADII OF GYRATION with respect to PRINCIPAL AXES:
R1 R2 R3 8.8098137e-01 1.5325060e+00 1.5325066e+00 INCH
--------------------------------------------------------------------------------
Select Datum, Point, Offset Csys from the INSERT Drop Down Menu, With Dims, Select the coordinate system created in step 1. Specify the coordinate system type Cartesian, and select Enter Points from the POINT ARRAY menu. Enter some arbitrary x,y, and z translation dimensions.
--------------------------------------------------------------------------------
Create relations involving the datum point's translation dimensions, which will place the point at the center of gravity of the part.
Syntax:
$d#=mp_cg_x("path","coord_sys","path")
$d#=mp_cg_y("path","coord_sys","path")
$d#=mp_cg_z("path","coord_sys","path")
d# is the dimension number
The first path is the path to the component for which the value will be calculated. The second path is the path to the component which contains the coordinate system. Since this is a part, there is no path to specify, because a part has no components.
coord_sys is the coordinate system name that the mass properties of the part were calculated from.
The dimensions on the left side of the equations are preceded by dollar signs to allow for negative values. Without the dollar signs, the following error message will appear:
ERROR: Invalid attempt to assign negative value to 'd#'. Please re-enter:
For this example, the relations will be:
$D35 = mp_cg_x("","CS0","")
$D36 = mp_cg_y("","CS0","")
$D37 = mp_cg_z("","CS0","")
This will place the datum point at the center of gravity of the part.
--------------------------------------------------------------------------------
Next, place a coordinate system on the point with axes parallel to the corresponding axes on the coordinate system created in step 1 above. This will be used to measure the angular rotation of the center of gravity from the coordinate system.
--------------------------------------------------------------------------------
Next, recalling the rotational angles from Step 2, create a coordinate system at the point, rotated the same amount as indicated by the mass property information. For this example, the rotational angles are x=90, y=0, and z=90.