.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Database.SaveAs() throwing eVetoed - unsupported version

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
374 Views, 0 Replies

Database.SaveAs() throwing eVetoed - unsupported version

Hi.

 

I'm trying to change SummaryInfo (add custom properties) in file, then save it.

 

When I'm trying to .SaveAs() the Database, there's a MessageBox saying the drawing was created by incompatibile version, the commands of the Mechanical program will be blocked and it's not possible to save the drawing in this version of the program. Sorry - my interface is in Polish, so I don't know, what the "original" message is.

 

I tried extdb.OriginalFileVersion and DwgVersion.Current - nothing helps.

In the log there's eVetoed Exception thrown by SaveAs().

 

Now I've got two problems:

1. How to save the drawing (it opens, so why can't I save it)?

2. The .SaveAs() is inside try/catch block and yet it shows MessageBox (but the Exception is catched and logged) - how can I prevent it from showing (I've got my own loggin "system")?

 

Part of my code (without try-catch and other unnecessary parts) is:

 

 

// check is file from "path" exists etc... DONE

// create new Database
Database extdb = new Database(false, true);

// make a copy of file to save database to
File.Copy(path, path + "-bak");

// read original file
extdb.ReadDwgFile(path, System.IO.FileShare.Read, false, "");

DatabaseSummaryInfoBuilder dbldr = new DatabaseSummaryInfoBuilder(extdb.SummaryInfo);

/*
    Change/add some custom properties to extdb.
    This works - 100% sure.
*/

// save database to copy
extdb.SummaryInfo = dbldr.ToDatabaseSummaryInfo();
// the line below throws exception
extdb.SaveAs(path + "-bak", true, extdb.OriginalFileVersion, extdb.SecurityParameters);

// the rest is irrelevant

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost