Autocad not seeing Command Methods in new VB.net class

Autocad not seeing Command Methods in new VB.net class

ralstogj
Collaborator Collaborator
767 Views
2 Replies
Message 1 of 3

Autocad not seeing Command Methods in new VB.net class

ralstogj
Collaborator
Collaborator

Hi

 

I have an exisitng project that I have added a new class to and then inserted the following code for

a new custom command as per the basic tutorial

 

    Imports Autodesk.AutoCAD.Runtime

   

Public Class Class1

        <CommandMethod("HelloWorld")> _

        Public Sub HelloWorld()

            MsgBox ("hello")

        End Sub

    End Clas

 

When I debug and netload the solution autocad does not see the new custom command in the new class

but sees the existing commandmethods in older classes. What am I missing?

 

Regards

 

 

Justin Ralston

Regards

Justin Ralston
http://c3dxtreme.blogspot.com/
0 Likes
768 Views
2 Replies
Replies (2)
Message 2 of 3

ralstogj
Collaborator
Collaborator

Found the problem in the other class from the shipped pipe example

it had a line similar to this with the CommandClass

 

[assembly: CommandClass(typeof(Test.Test))]

 

which is discussed here

http://www.theswamp.org/index.php?topic=20708.0

 

not sure what it does but commented it out and now all the command methods work in all classes.

 

Justin Ralston

Regards

Justin Ralston
http://c3dxtreme.blogspot.com/
0 Likes
Message 3 of 3

chiefbraincloud
Collaborator
Collaborator

Declaring a Class as a CommandClass tells AutoCAD to look there for command methods and causes AutoCAD to not look anywhere else in that assembly.  It is all about loading speed.

Dave O.                                                                  Sig-Logos32.png
0 Likes