Hi,
I've to add a barcode picture to the drawings, so I have a simple macro for that, that works fine.
My problem is: if the drawing changes, before I inster a new barcode, I have to delete the previous, but I don't know the object name, because on every "InsertSketchPicture" the object name counter will rise (Sketch Picture1, Sketch Picture2, etc).
One solution if I rename the inserted picture, but I don't know how can I do this. Can I rename somehow the inserted picture's object?
Ant thats it, I don't know other solution, but if somebody has any idea, please share that with me.
my code part is:
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
.....
Part.EditTemplate
Set SkPicture = Part.SketchManager.InsertSketchPicture("C:\barcode.png")
SkPicture.SetOrigin 0.0128, 0.0052
SkPicture.SetOrigin 0.13, 0.0052
SkPicture.SetSize 60 / 1000, 9 / 1000, True
Part.EditSheet
...
thank you
SolidworksApi macros