I regularly create a sketch in the top plane and insert a sketch picture, but the location of the sketch picture is different every time. Is there a way to run a macro that takes me to the Open dialogue so I can navigate to the image myself?
This macro inserts the same image every time.
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("Top Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
Part.SketchManager.InsertSketch True
Dim SkPicture As Object
Set SkPicture = Part.SketchManager.InsertSketchPicture("File Location")
End Sub
What can I change so it lets me choose what image to open?
Thank you
Hi Liam
This should help
2016 SOLIDWORKS API Help - Open File Example (VBA)