EPLAN API 入门系列- 提高篇(How to Add/Remove GraphicalLayer?)
2013-03-24 15:12
633 查看
Add GraphicalLayer:
GraphicalLayer oGpl = null; GraphicalLayerTable layerTable = oPage.Project.LayerTable; if (oGpl == null) { oGpl = new GraphicalLayer(); MultiLangString description = new MultiLangString(); description.AddString(ISOCode.Language.L___, "Graphic.General"); oGpl.Pen.ColorId = 1; oGpl.Create(layerTable, "Epl" + cnt.ToString(), description); } foreach (GraphicalLayer layer2 in layerTable.Layers) { if (layer2.Name == "Epl0" || layer2.Name == "Epl1") { oGpl = layer2; if (!oGpl.isVisible) { oGpl.isVisible = true; } oGpl.Pen.ColorId = 1; oGpl.Store(); } }
Remove GraphicalLayer:
GraphicalLayer layer = null; GraphicalLayerTable layerTable = currentProject.LayerTable; GraphicalLayer[] layers = layerTable.Layers; for (int num = 0; num < layers.Length; num++) { GraphicalLayer layer2 = layers[num]; if (layer2.Name == "Epl0" || layer2.Name == "Epl1") { layerTable.RemoveLayer(layers[num]); } }
相关文章推荐
- EPLAN API 入门系列- 提高篇(How to get Symbol via Function)
- EPLAN API 入门系列- 提高篇(How to get PartProperty via partNo)
- EPLAN API 入门系列- 提高篇(How to get PropertyValue?)
- EPLAN API 入门系列- 实战篇(How to Change Properties in EPlan?)
- EPLAN API 入门系列- 提高篇(How to get all connections which are not in location box)
- EPLAN API 入门系列- 提高篇(How to Insert WindowMacro?)
- Go语言入门系列1:安装,How to Write Go Code
- Go语言入门系列1:安装,How to Write Go Code
- How to Add and Remove Apps
- The robot API &&How to add and use sensor.
- iphone dev 入门实例7:How to Add Splash Screen in Your iOS App
- wrapEasyMonkey howto入门教程和wrapEasyMonkey api 资料文档
- How To Use A Launchpad PPA (Add, Remove, Purge, Disable) In Ubuntu
- Delphi Open Tools API - How to create and add new menu item
- How to implement a many-to-many relationship using Linq to Sql ? Part II : add/remove support (转)
- How to add remove user (standard user/non-root) in Kali Linux?
- How to remove a layer when its animation completes?
- How to solve “add/remove operation is impossible, because the code element 'Cxxx' is read only”
- Magento how to remove the catelog filter from the layer navigation?
- How to hide an entry in the Add/Remove Programs applet?