Is there a way to create a macro for publishing 3D PDFs?

I have a lot of parts that need to be published to 3D PDF with the MBD annotations. I tried recording a macro but it didnt seem to work. Any suggestions?

SolidworksApi/macros