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 }
  • 相关阅读:
    redis 使用
    VS----id为xxxx的进程当前未运行 问题
    bootstrap--------bootstrap table显示行号
    js--------js获取当前时间,返回日期yyyy-MM-dd
    CLR via C#--------CLR的执行模式
    Python链表成对调换
    Python去除列表中的重复元素
    MySQL索引背后的数据结构及算法原理
    Python 垃圾回收机制
    Python 里的拷贝
  • 原文地址:https://www.cnblogs.com/AriLee/p/2987247.html
Copyright © 2011-2022 走看看