.net - Can't handle exception Errorstatus.EInvalidKey in Autocad -
ok, usual autodesk has little no documentation on subject i'm trying glean seniors here. i'm attempting write bit of code perform wblock operation on list of xrefs in file. when try go through wblock process though autocad raises error stating there's invalid key. have no idea how handle particular exception , autodesk has no documentation on it. have ideas?
foreach (blocktablerecord x in xlist) { ...... //if xref doesn't exist... if (!file.exists(path.combine(filepath, newxrefs, xrname))) { try { //write file out base location same name database xdata = x.getxrefdatabase(true); database newxref = adbase.wblock(x.objectid); newxrpath = path.combine(filepath, newxrefs, xrname); newxref.saveas(newxrpath, dwgversion.ac1021); } catch (autodesk.autocad.runtime.exception aex) { if (aex.errorstatus == errorstatus.invalidkey) { //what do here?? or how prevent exception? } } }
Comments
Post a Comment