Manage Links Methods
- Last UpdatedMay 02, 2022
- 1 minute read
Note:
This method should be used only when all of the databases holding objects that have
been linked are current on the Multiple Database (MDB).
The MMManageLinks object provides a method to validate and clean uplinks. To use this method the following initialization is required at the top of each Programmable Macro Language (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 returns a BOOLEAN which will be TRUE if there are no links with invalid references, or FALSE if there are link objects with invalid references, such as may have occurred when objects have been deleted. It also outputs a list of links and any errors to the command line.
Note:
The validate method is not read only; it merges partially populated links, for example,
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. This merging has to occur before it can check for invalid
links.
!foundInvalidLinks = !!mmManageLinks.validate().not()
The removeInvalidLinks method deletes any link objects with invalid references.
!!mmManageLinks.removeInvalidLinks()
Note:
The MMManageLinks object is not available in 12.1.SP4, use the following integrator
object instead:
-
Use the equivalent initialization
!!integratorInit()
-
Use the equivalent method:
!!Integrator.validateLinks()