Custom results output allows you to pass MotionSolve results directly to a user-written subroutine denoted by POST_SUB. MotionSolve calls POST_SUB at every successful integration time step which uses the MotionSolve Result API for generating the results in a customized format. You have access to the same data as passed to the MotionSolve MRF file (shown here in HyperGraph) via POST_SUB, as shown in the image below.
HyperGraph panel for POST_SUB access
1. | Add the <Post_UserAPI/> element to the MotionSolve XML input file. |
<Post_UserAPI/> element
2. | Write a POST_SUB: |
Code in POST_SUB
3. | From within POST_SUB, call access functions to get the states of selected entity types. |
These access functions are:
• | c_get_post_states |
• | c_getnumid |
• | c_getidlist |
as shown in the image below. Valid entity types are PART, POINT_MASS, FLEX_BODY, and REQUEST.
POST_SUB’s three access functions
The image below shows an example of the results accessed in POST_SUB in XML format:
Results written out in XML format