The proxy object is passed by VA to the plugin Invoke() function as a standard parameter, so its scope is just local to that function.
If you want the variable to be available elsewhere, you need to bounce it forward as a parameter again, or store a reference somewhere else with a broader scope.
Personally, I made a base class to acts as a handler for all the other features in the plugin; the Invoke() code simply initialize the correct instance, and passes a reference to vaProxy that is stored in a protected property, so it's now available to all the inherited classes
A small excerpt taken from VAExtentions:
Public Shared Sub VA_Invoke1(vaProxy As Object)
'The factory class gives back the correct instance of an inherited class, based on the 'vaProxy.Context' value, and store the full vaProxy object as a property
Dim contextHandler As ContextHandlerBase = ContextFactory.Create(vaProxy)
If contextHandler Is Nothing Then
vaProxy.SetSmallInt(App.KEY_ERROR, ContextHandlerBase.ERR_CONTEXT)
vaProxy.SetText(App.KEY_RESULT, String.Format("Unsupported or empty context: '{0}'.", vaProxy.Context))
Else
'This is where the actual code is performed
contextHandler.Execute()
End If
End Sub
where ContextHandlerBase is something like this:
Public MustInherit Class ContextHandlerBase
Protected Context As ContextFactory.Contexts
Protected VAProxy As Object
Public Sub New(ByVal context As ContextFactory.Contexts, vaProxy As Object)
Me.Context = context
Me.VAProxy = vaProxy 'this will then be accessible by all inherited classes
End Sub
Public MustOverride Function Execute() As Boolean
End Class
You don't necessarly need to go into this complexities if you don't like it; simply add a (vaProxy As Object) parameter to all your subroutines and you are good to go.