using Eplan.EplApi.ApplicationFramework; using Eplan.EplApi.Base; using Eplan.EplApi.DataModel; using Eplan.EplApi.DataModel.MasterData; using Eplan.EplApi.HEServices; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Primetals.EplAddIn.UpdateStructureIdentifier { internal class placeMacro : IEplAction { public bool Execute(ActionCallingContext oActionCallingContext) { SelectionSet selectionSet = new SelectionSet(); Project project = selectionSet.GetCurrentProject(false); string emp = @"C:\TEMP\Testmakros\pagemacro.emp"; string ema = @"C:\TEMP\Testmakros\Fenster3.ema"; PageMacro pageMacro = new PageMacro(); pageMacro.Open(emp, project); foreach (Page p in pageMacro.Pages) { PagePropertyList ppl = p.NameParts; ppl.DESIGNATION_DOCTYPE = "EFS"; ppl.DESIGNATION_LOCATION = "A"; ppl.DESIGNATION_PLANT = "O"; p.NameParts = ppl; } Insert insert = new Insert(); insert.PageMacro(pageMacro, project, null, PageMacro.Enums.NumerationMode.Number); PointD pointD = new PointD { X = 200, Y = 200 }; insert = new Insert(); Page oPage = project.Pages[1]; // --> zweite Seite des 4 seitigen Seitenmakros insert.WindowMacro(ema, 0, oPage, pointD, Insert.MoveKind.Absolute); return true; } public void GetActionProperties(ref ActionProperties actionProperties) { throw new NotImplementedException(); } public bool OnRegister(ref string Name, ref int Ordinal) { Name = "placeMacro"; Ordinal = 20; return true; } } }