The following plugin opens the path diagram, Ex08.amw, and changes the color of two variables and one path to yellow. The UndoToHere / UndoResume method pair allows you to undo the changes by pressing .
Imports Microsoft.VisualBasic
Imports Amos
Imports Amos.pd
Imports System.drawing
<System.ComponentModel.Composition.Export(GetType(IPlugin))>
Public Class CustomCode
Implements IPlugin
Public Function Mainsub() As Integer Implements IPlugin.Mainsub
Dim V1 As PDElement
Dim V2 As PDElement
Dim P As PDElement
If FileOpen(AmosDir & "Examples\English\Ex08") Then
Return 0
End If
UndoToHere()
V1 = PDE("spatial")
V2 = PDE("visperc")
P = PDE(V1, V2)
V1.BorderColor = Color.Yellow.ToArgb
V2.BorderColor = Color.Yellow.ToArgb
P.BorderColor = Color.Yellow.ToArgb
DiagramRedrawDiagram()
UndoResume()
End Function
Public Function Name() As String Implements IPlugin.Name
End Function
Public Function Description() As String Implements IPlugin.Description
End Function
End Class