The following plugin asks the user if it is ok to change the border colors of objects in the path diagram. If the user responds "yes", the program sets the border colors to magenta. The EnableUserInteraction2 method is used to prevent the user from interacting with the Amos Graphics window while the program is waiting for a user response.
Imports Microsoft.VisualBasic
Imports Amos
Imports Amos.pd
<System.ComponentModel.Composition.Export(GetType(IPlugin))>
Public Class CustomCode
Implements IPlugin
Public Function Mainsub() As Integer Implements IPlugin.Mainsub
Dim x As PDElement
Dim Result As MsgBoxResult
EnableUserInteraction2(False, False)
Result = MsgBox("Do you want to change the border colors?", vbYesNo)
EnableUserInteraction2(True, False)
If Result = vbYes Then
For Each x In pd.PDElements
x.BorderColor = System.Drawing.Color.Magenta.ToArgb
pd.refresh()
Next
End If
End Function
Public Function Name() As String Implements IPlugin.Name
End Function
Public Function Description() As String Implements IPlugin.Description
End Function
End Class