개정판 077ee0f2
Modify Database UpdateExt. Run File Recovery.
Change-Id: I82b20435164d7a7a0fef1a5734d142b7e9956a2f
DTI_PID/OdReadExMgd/OdReadExMgd.cs | ||
---|---|---|
3330 | 3330 |
else |
3331 | 3331 |
helperDevice.BackgroundColor = System.Drawing.Color.FromArgb(0, 173, 174, 173); |
3332 | 3332 | |
3333 |
helperDevice.ActiveView.ZoomExtents(pDb.Extmin, pDb.Extmax); |
|
3334 |
helperDevice.ActiveView.Zoom(0.99); |
|
3335 |
helperDevice.Update(); |
|
3333 |
if (helperDevice.ActiveView != null) |
|
3334 |
{ |
|
3335 |
helperDevice.ActiveView.ZoomExtents(pDb.Extmin, pDb.Extmax); |
|
3336 |
helperDevice.ActiveView.Zoom(0.99); |
|
3337 |
helperDevice.Update(); |
|
3336 | 3338 | |
3337 |
Export_Import.ExportBitmap(helperDevice, bmpPath); |
|
3339 |
Export_Import.ExportBitmap(helperDevice, bmpPath); |
|
3340 |
} |
|
3341 |
else |
|
3342 |
{ |
|
3343 |
throw new System.Exception("ViewPort?? ???? ?? ?????????"); |
|
3344 |
} |
|
3338 | 3345 |
} |
3339 | 3346 |
} |
3340 | 3347 |
} |
... | ... | |
3696 | 3703 |
using (Database newDb = new Database(true, false)) |
3697 | 3704 |
{ |
3698 | 3705 |
pDb.Wblock(newDb, objIdCol, Point3d.Origin, DuplicateRecordCloning.Ignore); |
3706 |
newDb.UpdateExt(false); |
|
3699 | 3707 |
newDb.UpdateExt(true); |
3700 | 3708 |
newDb.SaveAs(filePath, DwgVersion.Newest); |
3701 | 3709 |
} |
... | ... | |
4184 | 4192 |
} |
4185 | 4193 |
} |
4186 | 4194 | |
4195 |
Extents3d extents = new Extents3d(pDb.Extmin, pDb.Extmax); |
|
4187 | 4196 |
// SEC Title box Move & Erase |
4188 | 4197 |
using (BlockTable pTable = (BlockTable)pDb.BlockTableId.Open(OpenMode.ForRead)) |
4189 | 4198 |
{ |
4190 | 4199 |
string blockName = "Titlebox"; |
4191 |
Extents3d extents = new Extents3d(); |
|
4200 | ||
4192 | 4201 |
bool isOK = false; |
4193 | 4202 |
if (pTable.Has(blockName)) |
4194 | 4203 |
{ |
... | ... | |
4248 | 4257 |
} |
4249 | 4258 |
} |
4250 | 4259 |
} |
4251 |
|
|
4260 |
pDb.UpdateExt(false); |
|
4252 | 4261 |
pDb.UpdateExt(true); |
4262 |
pDb.Extmin = extents.MinPoint; |
|
4263 |
pDb.Extmax = extents.MaxPoint; |
|
4253 | 4264 |
} |
4254 | 4265 |
public void dumpHeader(Database pDb, int indent, XmlNode node) |
4255 | 4266 |
{ |
... | ... | |
5085 | 5096 |
* Note the 'using' clause - generally, wrappers should disposed after use, |
5086 | 5097 |
* to close underlying database objects |
5087 | 5098 |
/******************************************************************/ |
5099 |
string recoverPath = args[0]; |
|
5100 |
using (AuditInfo auditInfo = new AuditInfo()) |
|
5101 |
{ |
|
5102 |
auditInfo.FixErrors = true; |
|
5103 |
Teigha.Runtime.FileStreamBuf streamBuf = new FileStreamBuf(args[0]); |
|
5104 |
using (Database rDb = HostApplicationServices.Current.recoverFile(streamBuf, auditInfo, "")) |
|
5105 |
{ |
|
5106 |
int count = auditInfo.NumErrors; |
|
5107 |
string path = Path.GetDirectoryName(recoverPath); |
|
5108 |
recoverPath = Path.Combine(path, "Recover.Dwg"); |
|
5109 |
rDb.SaveAs(recoverPath, rDb.OriginalFileVersion); |
|
5110 |
} |
|
5111 |
} |
|
5088 | 5112 |
using (Database pDb = new Database(false, false)) |
5089 | 5113 |
{ |
5090 |
pDb.ReadDwgFile(args[0], FileShare.Read, true, ""); |
|
5114 |
//pDb.ReadDwgFile(args[0], FileShare.Read, true, ""); |
|
5115 |
pDb.ReadDwgFile(recoverPath, FileShare.Read, true, ""); |
|
5091 | 5116 |
HostApplicationServices.WorkingDatabase = pDb; |
5092 | 5117 |
/****************************************************************/ |
5093 | 5118 |
/* Display the File Version */ |
내보내기 Unified diff