private static ObjectId ImportMissedRecord(SymbolTable srcTable, string key, SymbolTable destTable) { if (string.IsNullOrEmpty(key)) { throw new ArgumentNullException("ImportMissedRecord(" + srcTable.GetType().Name + ".key)"); } if (destTable.Has(key)) // It is not missed { return(destTable[key]); } if (!srcTable.Has(key)) { throw new KeyNotFoundException("'" + key + "' not found in " + srcTable.GetType().Name); } Ac.WriteLn("Updating " + destTable.GetType().Name + "... "); // Updating BlockTable... using (var mapping = new IdMapping()) using (var sourceIds = new ObjectIdCollection()) { sourceIds.Add(srcTable[key]); srcTable.Database.WblockCloneObjects(sourceIds, destTable.ObjectId, mapping, DuplicateRecordCloning.Ignore, false); Ac.Write(string.Format("'{0}' added.", key)); // G7-FixedPoint added. return(destTable[key]); } }
public static void SetProgress(int pos) { progressPos = pos; int newPercent = (int)((double)pos / (double)progressSteps * 100.0); if (newPercent > progressPercent) { progressPercent = newPercent; #if AutoCAD Autodesk.AutoCAD.Internal.Utils.SetApplicationStatusBarProgressMeter(newPercent); #else if (progressSteps > 99) { if (newPercent % 10 == 0) { Ac.Write(newPercent.ToString()); Ac.Editor.UpdateScreen(); } else if (newPercent % 2 == 0) { Ac.Write("."); } } //Editor.UpdateScreen(); #endif //DoEvents(); } }