Save part as dxf macro

Hello

I'm looking for help to create a macro to save the top view of a part as a dxf in the same location as the solidworks file is saved.

I would like it to first save the solidworks part, and to replace any existing dxf if there's one with the same name already saved.

I could find macros for drawing files and for sheet metal parts but not for a normal part.

much appreciated if anyone could point me in the right direction.

SolidworksApi/macros