How to save a drawing as dwg with Solidworks API?
check out this help page.
SaveAs2 Method (IModelDocExtension)
If you need more information, please post your macro/api code that you have so far. If you don’t have that, we would need to know a bit more about what you’re looking to do.
As a resource, this may give you a start: