PCL and Customization > Accessing the Patran Database > Coordinate Frames
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
Coordinate Frames
Exporting Coordinate Frame Data
The function used to extract coordinate frame information from the Patran database is given below.
 
db_get_coord
( <coord_id>, <dummy_id>, <coord_type>, <coord_origin>, <coord_trans_mat> )
  
Input:
 
 
INTEGER
<coord_id>
The ID of the coordinate frame of interest.
Output:
 
 
INTEGER
<dummy_id>
A dummy internal ID which is no longer used.
INTEGER
<coord_type>
A flag specifying the type of coordinate frame:
1 = Rectangular Frame
2 = Cylindrical Frame
3 = Spherical Frame
REAL ARRAY
<coord_origin>
The global rectangular position vector describing the origin of the frame
REAL ARRAY
<coord_trans_mat>
The 3x3 local to global transformation matrix of the frame.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFGetCoordinateFrame.
int DbFGetCoordinateFrame ( coord_id, dummy_id, coord_type, coord_origin,
	 coord_trans_mat)
 int 	coord_id
 int 	*dummy_id
 int 	*coord_type
float 	*coord_origin
float 	coord_trans_mat[ ][3]
Importing Coordinate Frame Data
When adding coordinate frame data to a database, not only does the frame data need to be added but the new frame must be posted. The function used to add frame data to the database is described below.
 
db_create_coord
( <coord_id>, <coord_type>, <coord_origin>, <coord_trans_mat>, <dummy_id> )
  
Input:
 
 
INTEGER
<coord_id>
(only input if input value of <coord_id> > 0) the ID of the frame to be added to the database. If zero, Patran will assign a unique ID to this frame and return the value in <coord_id>.
INTEGER
<coord_type>
A flag specifying the type of coordinate frame:
1 = Rectangular Frame
2 = Cylindrical Frame
3 = Spherical Frame
REAL ARRAY
<coord_origin>
The global rectangular position vector describing the origin of the frame.
REAL ARRAY
<coord_trans_mat>
The 3x3 local to global transformation matrix of the frame.
INTEGER
<dummy_id>
The internal ID of the coordinate frame. No longer used. Zero can be input here.
Output:
 
 
INTEGER
<coord_id>
(only output if input value of <coord_id> = 0) the unique ID assigned to this new frame by Patran.
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFCreateCoordinateFrame.
int DbFCreateCoordinateFrame ( coord_id, coord_type, coord_origin, coord_trans_mat, dummy_id		 )
int 	*coord_id
float 	coord_origin [ ]
float 	coord_trans_mat [ ][3]
int 	coord_type
int 	*dummy_id
 
db_get_coord_ref_coord
( coord_id, refcid, xmat_lcl )
Description:
 
 
Get the reference frame for a specified coordinate frame definition
Input:
 
 
INTEGER
coord_id
The coordinate frame ID
Output:
 
 
INTEGER
refcid
The ID of the reference frame (zero if no reference found)
REAL
xmat_lcl(4,4)
The 4x4 transformation matrix of the coordinate frame relative to the reference frame (includes translation and rotation)
Error Conditions:
 
 
 
db_get_coord_ref_nodes
( coord_id, node_ids )
Description:
 
 
Get the reference nodes for a specified coordinate frame
Input:
 
 
INTEGER
coord_id
The coordinate frame ID
Output:
 
 
INTEGER
node_ids(3)
The IDs of the three node references (zeros if no references found)
INTEGER
<Return Value>
This function returns a value of zero if successful.
Error Conditions:
 
 
 
db_set_coord_ref_coord
( coord_id, refcid, xmat_lcl )
Description:
 
 
Set the reference frame in a coordinate frame definition
Input:
 
 
INTEGER
coord_id
The coordinate frame ID
INTEGER
refcid
The ID of the reference frame (0 to remove an existing reference)
REAL
xmat_lcl(4,4)
The 4x4 transformation matrix of the coordinate frame relative to the reference frame (includes translation and rotation)
Output:
 
 
INTEGER
<Return Value>
This function returns a value of zero if successful.
Error Conditions:
 
 
 
db_set_coord_ref_nodes
( coord_id, node_ids )
Description:
 
 
Set the reference nodes in a coordinate frame definition
Input:
 
 
INTEGER
coord_id
The coordinate frame ID
INTEGER
node_ids(3)
The IDs of the three node references (zeros to remove existing references)
Output:
 
 
INTEGER
<Return Value>
This function returns a value of zero if successful.
Error Conditions:
 
 
To post the newly created coordinate frame to graphics, use the function described below.
 
db_post_coord
( <coord_id> )
 
Input:
 
 
INTEGER
<coord_id>
The ID of the coordinate frame to be posted to graphics.
Output:
 
 
INTEGER
<Return Value>
This function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.
Notes:
The C name differs. It is DbFPostCoordinateFrame.
int DbFPostCoordinateFrame ( coord_id )
 int 	coord_id