Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Why is Inventor 2016 Overwriting Files with a Save-As????

Anonymous

Why is Inventor 2016 Overwriting Files with a Save-As????

Anonymous
Not applicable

Hello All,

 

Can anyone tell me how i can stop my code from overwriting files or do i have to review by entire suite of programs? Partly my fault of course as i was using the oInvDoc.SaveAs that if the file exists when given the new path, it would error out in which i would catch and do some stuff to find a new part number (yes i understand, its shotty, but i program for my team to get the 80% functionality for the 20% work).

 

So now, oPart.SaveAs will overwrite good files without an error. Is there a simple way to change it back to "error out"?

 

Thanks,

 

0 Likes
Reply
Accepted solutions (1)
439 Views
2 Replies
Replies (2)

GeorgK
Advisor
Advisor
Accepted solution

Hello Andrew,

 

Dim curFile As String = "c:\temp\test.ipt"
Console.WriteLine(If(File.Exists(curFile), "File exists.", "File does not exist."))

 

Cheers

 

Georg

0 Likes

Anonymous
Not applicable

its unfortunate, but thats what i ended up doing. had to rewrite a ton of stuff. I wonder how many more easter eggs there are waiting to smack amateur programmers in the face LOL

0 Likes