Basically it has to open the 2d drawing of a selected file from the assembly generate the PDF and close, I got something, but it only works with the path file, I do not know which command to use to make it work with whatever file you choose .
' ******************************************************************************
' C:\Users\Home\AppData\Local\Temp\swx9936\Macro1.swb - macro recorded on 06/29/16 by Home
' ******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("PLACA BASE SUPERIOR-1@MOLDE HÉLICE", "COMPONENT", 0, 0, 0, False, 0, Nothing, 0)
Set Part = swApp.OpenDoc6("D:\PROJETOS SOLIDWORKS\PAULINHO FERRAMENTARIA\MOLDE HELICE-2\PLACA BASE SUPERIOR.SLDDRW", 3, 0, "", longstatus, longwarnings)
Set Part = swApp.ActiveDoc
swApp.ActivateDoc2 "PLACA BASE SUPERIOR - Sheet1", False, longstatus
''''''''''''''''''''''''''
Dim FilePath As String
Dim PathSize As Long
Dim PathNoExtention As String
Dim NewFilePath As String
FilePath = Part.GetPathName
PathSize = Strings.Len(FilePath)
PathNoExtention = Strings.Left(FilePath, PathSize - 6)
NewFilePath = PathNoExtention & "pdf"
Part.SaveAs2 NewFilePath, 0, True, False
Set Part = Nothing
swApp.CloseDoc "PLACA BASE SUPERIOR - Sheet1"
End Sub