Hallo, ik ben erin geslaagd om het importeren van een afbeelding op een solidworks-plan te automatiseren, maar aan het einde van de reeks wordt de afbeelding geselecteerd en kan ik deze selectie niet verlaten via mijn code.
Function codebarreDRAW(FCB As String, namePL As String)
'Import of the barcode or QRcode on the solidworks plan
'Variable declaration
Dim myModelView As Object
Dim swModel As ModelDoc2
Dim swApp As SldWorks.SldWorks
Dim Errors As Long
Dim swLoadWarnings As Long
Dim Fplan As String
Dim L As Double
Dim H As Double
Dim value As Integer
Dim coef As Double
Dim part As Object
'Variable initialisation
Fplan = namePL & ".SLDDRW"
Set swApp = Application.SldWorks
'Draw window activation
Set swModel = swApp.ActivateDoc3(Fplan, False, swRebuildOnActivation_e.swRebuildActiveDoc, Errors)
Set part = swApp.ActiveDoc
Dim SkPicture As Object
'Insertion of the barcode or QRcode in the draw
Set SkPicture = part.SketchManager.InsertSketchPicture(FCB)
'Retrieving the barcode size
value = SkPicture.GetSize(L, H)
'Definition of the size and position of the bar code
SkPicture.SetSize L * coefAGRimg, H * coefAGRimg, True
SkPicture.SetOrigin PosX, PosY
End Function
Ik wil graag simuleren dat ik op de groene V klik.
Als iemand een idee heeft, ben ik er helemaal voor.
Bedankt