AnsweredAssumed Answered

How to insert sketch picture from url?

Question asked by Alexey Kovalov on Feb 7, 2018
Latest reply on Feb 8, 2018 by Alexey Kovalov

Hello everyone!

 

I need to insert QR-code picture (http://api.qrserver.com/v1/create-qr-code/?data=Test%20code?&size=100x100) to drawing in specific coordinates.

The macro below make all I need then I want to insert picture from PC. But it can’t insert picture from url.

Is it possible to insert sketch picture from url to drawing?

Regards,

Alexey

 

Macro:

Dim swApp As Object

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

Dim SkPicture As Object

Dim sFile As String

sFile = "d:\1.png"

    Part.EditTemplate '''''enter in edit sheet format

    Set SkPicture = Part.SketchManager.InsertSketchPicture(sFile)

    SkPicture.SetOrigin 0.397, 0.006

    SkPicture.SetSize 0.018, 0.018, 1

    Part.EditSheet ''''exit edit sheet format

End Sub

Outcomes