Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Gateways

Publishing Using PML Macros

  • Last UpdatedOct 06, 2025
  • 2 minute read

You can publish grids, DB views, drawings and datasheets using PML functions as well. To do this, you must first create a macro file that contains the commands to publish. Then, you must run the macro file by dragging it to the command window in AVEVA Engineering.

The following table describes the commands used for publishing:

Command

Description

import 'AVEVA.NET.Gateways.IED.PmlExtensions'

handle any

endhandle

Mandatory command that must be available in all macro files

IEDPublisher()

Name of the object used for publishing

SelectElement()

Command for selecting elements for publishing

SelectConfiguration()

Command for selecting the configuration

SetOption()

Command for settings the options

Publish()

Command for publishing

AvailableOptions()

Command for listing the available options

ErrorsNo()

Command for displaying the number of errors after the last Publish() action

The following table lists the options available with the SetOption() command.

Option

Default Value

Accepted Values

eiwmContextName

PROJECTCONTEXT

'<STRING>'

eiwmSuffix

_null

'<STRING>'

generateFolderVNETFile

False

'True' | 'False'

generateTriggerStartFile

False

'True' | 'False'

drawingProcessConnectedDrawings

False

'True' | 'False'

gridProcessColumnsMode

OnlyVisible

'All' | 'OnlyVisible'

itemProcessDataSourceElements

False

'True' | 'False'

itemProcessDatasheets

True

'True' | 'False'

itemProcessDrawings

True

'True' | 'False'

itemProcessGrids

True

'True' | 'False'

The following table lists the commands for publishing reports.

Command

Example

SelectReport(string <report file path>, bool <is scoped>)

!iedPublisher.SelectReport('C:\Users\Public\Documents\AVEVA\Everything3D\Data\DFLTS3.1\data\reports\DESIGN-Equipment_List.repv', false)

GetSelectedReports()

!reports = !iedPublisher.GetSelectedReports()

q var !reports

ClearSelectedReports()

!iedPublisher.ClearSelectedReports()

The following is an example of the contents of a macro file.

import 'AVEVA.NET.Gateways.IED.PmlExtensions'

handle any

endhandle

using namespace 'AVEVA.NET.Gateways.IED.PmlExtensions'

!publisher = object IEDPublisher()

--(APS) Centrifugal Pumps

!publisher.SelectElement('=23997/1366')

--(APS) Filters

!publisher.SelectElement('=23997/1330')

--(APS)P1501A_CENTRIPUMP_DST

!publisher.SelectElement('=23997/988')

--(APS)P1501B_CENTRIPUMP_DST

!publisher.SelectElement('=23997/989')

!publisher.SelectConfiguration('T1')

!publisher.SetOption('itemProcessDatasheets', false)

!publisher.SetOption('itemProcessGrids', true)

!publisher.SetOption('itemProcessDrawings', false)

!publisher.SetOption('drawingProcessConnectedDrawings', false)

!publisher.SelectDbView('CENTRIFUGALPUMP_View')

--(APS project) Selects DbView using it's unique name

!publisher.Publish()

!errorsNo = !publisher.ErrorsNo()

TitleResults for “How to create a CRG?”Also Available in