Im doing a macro to open a drawing from a path created inside the macro, like a selector, i have the path for the file i want to open but i dont know if there's any command to open an existing drawing
check into "OpenDoc"
You should use ISldWorks::OpenDoc6, like in this example. You can see where you'll need to replace the path I've provided with the correct path.
Dim swApp As SldWorks.SldWorks
Dim strPath as String
Set swApp = Application.SldWorks
strPath = "C:\myDrw.SLDDRW"
swApp.OpenDoc6 strPath, swDocDRAWING, Empty, Empty, Empty, Empty
You could also record yourself opening a part and then use that code. I explain how to use the macro recorder in lesson 2.1 in the Videos section of my web site.
SolidWorks API Training
Retrieving data ...