Esempio n. 1
0
 public void DeleteObject(ProcessObject obj)
 {
     // TODO удалить обработчики
     //obj.ProcessCurve.Modified -= ProcessCurveModifiedEventHandler;
     //obj.ProcessCurve.Erased -= ProcessCurveErasedEventHandler;
     if (obj.ToolpathCurve != null || obj.ProcessActions != null)
     {
         using (DocumentLock doclock = Document.LockDocument())
         {
             using (AcDb.Transaction trans = TransactionManager.StartTransaction())
             {
                 if (obj.ToolpathCurve != null)
                 {
                     trans.GetObject(obj.ToolpathCurve.ObjectId, AcDb.OpenMode.ForWrite);
                     obj.ToolpathCurve.Erase();
                 }
                 else
                 {
                     obj.ProcessActions.ForEach(p =>
                     {
                         trans.GetObject(p.Toolpath.ObjectId, AcDb.OpenMode.ForWrite);
                         p.Toolpath.Erase();
                     });
                 }
                 trans.Commit();
                 Editor.UpdateScreen();
             }
         }
     }
     RemoveConnect(obj, VertexType.Start);
     RemoveConnect(obj, VertexType.End);
     ObjectList.Remove(obj);
     ObjectForm.RefreshList();
 }
 [Autodesk.AutoCAD.Runtime.CommandMethod("add")] //, CommandFlags.UsePickSet)] // | CommandFlags.Redraw | CommandFlags.Modal)] //CommandFlags.Redraw SetImpliedSelection()SelectImplied
 public void AddObject()
 {
     SettingForm.UpdateParams();
     AddSelectedObject(ProcessOptions);
     PaletteSetShow();
     ObjectForm.RefreshList();
 }