首页 > 解决方案 > 如何使用 C# 从 AVEVA E3D 获取报告

问题描述

有谁知道如何使用 C# 从 AVEVA E3D 中提取报告?例如,如何使用C#获取管道名称、设备名称。

除了 .NET 定制指南之外,是否有任何文档可以阅读有关 AVEVA E3D 和 C# 的信息?

标签: c#

解决方案


将其写入 .txt 文件:

-- this is a comment
-- Change the path directory, this is your output

!path=|C:\Users\XXX\Desktop\extract.csv|

-- Here you can choose between a lot of type element, like pipe or equi for the sample
-- var !c is a declaration of variable, collect is a collection of type, all equi means every equipment of my MDB (multi database).
var !c collect all equi
-- The first line of my array contains Name, you can delete this if you don't need
!tab = array()
!tab.append('Name')

-- For each values of my array !c which contains all equipment, I do this action
Do !x values !c

    -- You can select your attribute, here I choose the name
    !name = !x.dbref().name
    -- I put the result of the name into my array
    !tab.append(!name)
Enddo

!file = object file(!path)
-- I create a object file with the name of my output file, then I choose the Append option and put my array on the output file.
!file.writefile('Append', !tab)

将其保存到 .txt 文件后,必须将其调用到 E3D 中,打开 E3D,打开命令窗口并写入:“$m C:\Users\XXX\Desktop\YourMacroName.txt”

$m 调用宏,语法为$m PathName\FileName 可以写成.txt 格式的宏,或者像每个AVEVA 宏一样,可以选择.pmlmac 格式(pml 宏)。格式无关紧要,它只是识别 AVEVA 宏的简单方法。


推荐阅读