Camera.SaveAsBitmap replace existing file

Camera.SaveAsBitmap replace existing file

J.VandeMerckt
Advocate Advocate
284 Views
2 Replies
Message 1 of 3

Camera.SaveAsBitmap replace existing file

J.VandeMerckt
Advocate
Advocate

Hi everyone.

For a thumbnail creator I'm using ray tracing and saving the files with the Camera.SaveAsBitmap.
Atm this doesn't work if the file already exists.

Is there a way to replace the existing file with the new file?
I don't see anything on the detail page of SaveAsBitmap: Inventor 2022 Help | Camera.SaveAsBitmap Method | Autodesk

Br
Justin

0 Likes
Accepted solutions (1)
285 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @J.VandeMerckt.  You could handle the search for the existing file, and its possible deletion yourself, in lines of code before the line of code that creates the new image file, like this:

Dim sImageFile As String = "C:\Temp\MyImage.bmp"
If System.IO.File.Exists(sImageFile) Then
	System.IO.File.Delete(sImageFile)
End If

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

J.VandeMerckt
Advocate
Advocate
Ok, was thinking about a replace function but deleting the file works too.
Thank you for the help.
0 Likes