Message 1 of 19
Custom Commands within Namespace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Initiated a project with the AutoDesk .net templates for VB.net. I've kept the ExtensionApplication loader that's part of the template, however commands that reside within my other classes aren't recognized. The extension is running because it's responding proplerly to events that trigger, however I can't call my custom command names from the command line. Could this be a function of the namespace that the commands are in?
Thanks in advance for your help.
Namespace IWC ' This class is instantiated by AutoCAD once and kept alive for the ' duration of the session. If you don't do any one time initialization ' then you should remove this class. Public Class MyPlugin Implements IExtensionApplication Public Sub Initialize() Implements IExtensionApplication.Initialize Dim NewLayer = New IWCLayer NewLayer.IWCLayerSysStart() End Sub Public Sub Terminate() Implements IExtensionApplication.Terminate MsgBox("Layer System Terminating", MsgBoxStyle.Critical) End Sub End Class End Namespace Namespace IWC ' This class is instantiated by AutoCAD for each document when ' a command is called by the user the first time in the context ' of a given document. In other words, non static data in this class ' is implicitly per-document! Public Class IWCLayer <CommandMethod("I3")> _ Public Sub I3() If ReturnStandardLayername(3) = False Then ChangeCurrentLayer(AddLayer(IWCGetStandardLayer(3))) Else ChangeCurrentLayer(ReturnStandardLayername(3)) End If End Sub Public Sub RegEvent() '**IWC** 'registeres event handlers for start and end commands Dim Doc As Document = Application.DocumentManager.MdiActiveDocument AddHandler Doc.CommandWillStart, AddressOf IWCLayerSysCheck AddHandler Doc.CommandEnded, AddressOf IWCLayerReturn AddHandler Doc.CommandCancelled, AddressOf IWCLayerReturn End Sub End Class End Namespace