zoukankan      html  css  js  c++  java
  • EPLAN API 入门系列 提高篇(How to Insert WindowMacro?)

                   internal const string NAME = "Example insert WindowMacro";                   
     1   ProjectManager prjMngr = new ProjectManager(); 2 SelectionSet oSelSet = new SelectionSet(); 3 Page oPage = (Page)oSelSet.GetSelectedPages().GetValue(0); 4 5 if (prjMngr.CurrentProject == null) 6 { 7 MessageBox.Show("No project is open.", ActionInsertMark.NAME, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 8 } 9 10 // get window macro file 11 OpenFileDialog dlg = new OpenFileDialog(); 12 dlg.InitialDirectory = prjMngr.Paths.Macros; 13 dlg.Title = "Select a window macro file"; 14 dlg.Filter = "Window macros (*.ema)|*.ema|All files|*.*"; 15 if (dlg.ShowDialog() != DialogResult.OK) 16 return true; 17 19 using (UndoStep us = (new UndoManager()).CreateUndoStep()) 20 { 21 //insert macro 22 Eplan.EplApi.DataModel.MasterData.WindowMacro macro = new Eplan.EplApi.DataModel.MasterData.WindowMacro(); 23 macro.Open(dlg.FileName, prjMngr.CurrentProject); 24 25 Insert insrt = new Insert(); 26 StorableObject[] arrInsertedObjs = insrt.WindowMacro(macro, 0, oPage, new PointD(), Insert.MoveKind.Relative); 27 28 //if (MessageBox.Show(string.Format("{0} objects inserted on page '{1}'.\n Do you want to undo this operation ?", arrInsertedObjs.Length, oPage.Name) 29 // , ActionInsertMark.NAME 30 // , MessageBoxButtons.YesNo 31 // , MessageBoxIcon.Question) == DialogResult.Yes) 32 //{ 33 // us.DoUndo(); 34 //} 35 }
  • 相关阅读:
    hdu.1226.超级密码(bfs)
    zstu.2512. Moving Tables(贪心)
    zoj.3868.GCD Expectation(数学推导>>容斥原理)
    acdream.LCM Challenge(数学推导)
    acdream.Triangles(数学推导)
    acdream.A Very Easy Triangle Counting Game(数学推导)
    acdream.Bet(数学推导)
    acdream.郭式树(数学推导)
    EntityFramework(转自wiki)
    石墨烯(转自wiki)
  • 原文地址:https://www.cnblogs.com/AriLee/p/2987247.html
Copyright © 2011-2022 走看看