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:
<p><span style="font-family: courier new,courier;">Set swApp = Application.SldWorks</span></p><p><span style="font-family: courier new,courier;">Set Part = swApp.ActiveDoc</span></p><p><span style="font-family: courier new,courier;">.....</span></p><p><span style="font-family: courier new,courier;">Part.EditTemplate</span></p><p><span style="font-family: courier new,courier;">Set SkPicture = Part.SketchManager.InsertSketchPicture("C:\\barcode.png")</span></p><p><span style="font-family: courier new,courier;">SkPicture.SetOrigin 0.0128, 0.0052</span></p><p><span style="font-family: courier new,courier;">SkPicture.SetOrigin 0.13, 0.0052</span></p><p><span style="font-family: courier new,courier;">SkPicture.SetSize 60 / 1000, 9 / 1000, True</span></p><p><span style="font-family: courier new,courier;">Part.EditSheet</span></p><p><span style="font-family: courier new,courier;">...</span></p>thank you
SolidworksApi macros