public static void LoadAvsToE3() { App?.PutInfo(0, "Load AVS to E3!"); Ex = (e3ExternalDocument)Prj.CreateExternalDocumentObject(); // Объекты массивов Id Object exIds = new Object(); string pename = ""; Prj.GetExternalDocumentIds(ref exIds); // Удаляем существующий PE try { foreach (var exId in (Array)exIds) { if (exId != null) { Ex.SetId((int)exId); pename = Ex.GetName(); if (pename.Right(3) == ".PE") { Ex.Delete(); App.PutInfo(0, $"Deleted {pename}"); } } } } catch (Exception e) { App.PutInfo(0, $"Error with {pename}"); App.PutInfo(0, $"First exception caught. {e}"); } Ex.Create(0, AVSName, AVSFileNew); //' Вставить новый AVS App?.PutInfo(0, $"File inserted - {AVSFileNew}"); }