Here is a simple example you could drop into a design and play around with. It adds a sphere (assuming you're using Inventor here) so maybe you should place it in an assembly design.
{code}
Method postCreateSelf() As List
Return {{:action, :createDynamicPart, _
:part, Me.NHA, _
:name, :TestSphere, _
:design, "IvSphere"}}
End Method
{code}
If you want to add a dynamic rule to a part, perhaps to set a mating part or something, you could add this to your design:
{code}
Method preCreateSelf() As List
Return {{:action, :createDynamicRule, _
:part, Me, _
:name, :MatingPart, _
:formula, ":TestSphere1"}}
End Method
{code}
The dynamic rule that is added will be of type Any. It may be possible to change that, though I don't know how.
Notice I have used both pre/post events. In this example I wasn't worried about which one was used, but your situation may require one or the other.
A couple other events I know of are preDeleteSelf and postDeleteSelf. I'm not sure what other events are available.
Hope this helps!