API equivalent of "Make drawing from part/assembly"

Can anyone offer any assitance of how to do the equivelant of the "make drawing from part/assembly" button in SW? I have tried to use the macro recoreder ont he make drawing button but that did not work.

There are several examples of how to create a drawing, using "newdoc", then add views of a defined part but there are no example of creating a drawing of an active part like the SW button does.

How do I link the newly created drawing doc to the previously active part/assembly doc so the drawing info is populated?

SolidworksApi macros