macro for dxf

I am looking for a macro to dxf my model piece parts.  Every time I create one it wont work due to the error of current view.

SolidworksGeneral