Compare/Update
User Guide
Compare and Update Data
: Using Compare/Update from PML
Using Compare/Update from PML
The main functions of Compare/Update can be called from PML using the CompareUpdate PML object. The following methods provide the equivalent of the main interactive functions.
Method
Description
selectDesign()
Select Design database source
selectSchematic()
Select Schematic database source
selectEngineering()
Select Engineering database source
compareEquipment()
Compare Equipment list
compareLines()
Compare Lines list
comparePipes()
Compare Pipes list
compareInstruments()
Compare Instruments list
compareValves()
Compare Valves list
comparePipingSpecials()
Compare Piping Specials list
compare(STRING configuration name)
Compare a named configuration
owner(STRING owner name )
Set the name of the owner for inserted elements
acceptAllDisplayed()
Accept all available changes including inserting new objects and updating attribute values
acceptAllLinked()
Accept linked objects (use this to unlink previously linked objects or update attributes on linked objects)
acceptAllMatched()
Accept all matched objects (use this to link all matched objects)
acceptAllUnmatched()
Accept all unmatched objects (use this to insert new objects)
updateLink()
Update the target database by inserting and linking elements and updating attribute values
updateUnlink()
Update the target database by unlinking elements
export(
STRING elements file path,
STRING attributes file path)
Following a compare operation, output the contents of the two grids into the named files in csv format
Note:
Integration with AVEVA Instrumentation, AVEVA Electrical and AVEVA P&ID are not currently supported from the command line and are available only interactively.
These methods require options and mappings to have been configured interactively.
A typical macro could include:
!run = object CompareUpdate()
!run.selectEngineering()
!run.compareEquipment()
!run.acceptAllDisplayed()
!run.updateLink()
MMTools Object
The MMTools object provides methods to link and unlink. Objects that could be linked interactively using Schematic 3D Integrator or Compare/Update can be linked in this way. To use these methods the following initialisation is required at the top of each PML file (object, function, or macro) where these methods are to be used.
import 'MMservices'
handle any
endhandle
The following initialisation is also required in each method, function or macro where the diagram methods are to be called.
using namespace 'Aveva.Pdms.MMServices'
!mmTools = object mmTools()
The string arguments can be a name like /MyName or a reference like =123/45678. If duplicate names are used, it is best to always use reference numbers to avoid confusion. The array arguments are arrays of strings of the same format.
!mmTools.link(!Name1 is STRING, !Name2 is STRING)
!mmTools.unlink(!Name is STRING)
!mmTools.unlink(!Names is ARRAY)
MMViewer Object
The MMViewer object provides diagram viewer methods. To use these methods the following initialisation is required at the top of each PML file (object, function, or macro) where these methods are to be used.
import 'MMservices'
handle any
endhandle
The following initialisation is also required in each method, function or macro where the diagram methods are to be called.
using namespace 'Aveva.Pdms.MMServices'
!mmViewer = object mmViewer()
The following methods can be used to clear colours and close the current or all diagrams.
!mmViewer.resetDiagramColours()
!mmViewer.resetAllDiagramColours()
!mmViewer.closeDiagram()
!mmViewer.closeAllDiagrams()
The findOnDrawing method opens the diagram for one or more schematic objects and highlights them.
Note:
That the argument is an array.
If an object appears on more than one diagram, you will be prompted to choose which diagram to open. This example shows how to view the linked schematic object for the current element in 3D.
!itemList[1] = !!ce.schlnk.ref.string()
!mmViewer.findOnDrawing(!itemList)
Individual schematic objects can be coloured on the diagram view using the following methods. Note that these methods do not open a diagram or select an object. The results will be visible only if the relevant diagram is already open in the viewer.
!mmViewer.setColour(!Name is STRING, !Colour is STRING)
!mmViewer.setColour(!Name is STRING, !Colour is REAL
MMManageLinks Object
The MMManageLinks object provides a method to validate links. To use this method the following initialisation is required at the top of each PML file (object, function, or macro) where this method is to be used.
import 'MMservices'
handle any
endhandle
The following initialisation is also required in each method, function or macro where the method is to be called.
using namespace 'Aveva.Pdms.MMServices'
!!mmManageLinks = object mmManageLinks()
The validate method outputs a list of links and any errors to the command line. It will also merge partially populated links, e.g. 3D object "A" is linked to schematic object "A" by one link and schematic object "A" is linked to engineering object "A" by another link, as can occur when links are created in separate extract databases.
!!mmManageLinks.validate()
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.