Save As Visible Layers Only

Is there any way in the API to save as only the visible layers to an slddrw?SolidworksApi macros