If you set your CommandMethods as normal class instance members:
Public Class MyCommands
_
Public Sub MyCommand()
'My code
End Sub
End Class
then AutoCAD will automatically instantiate your class when your command is called in a new document. However, if you make your CommandMethod a Shared (static in C#) method, then AutoCAD can call your method without instantiating your class:
Public Class MyCommands
_
Public Shared Sub MyCommand()
'My code
End Sub
End Class
You can test this by writing a constructor for your class and watching when its called.

Leave a Reply