.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autocad not seeing Command Methods in new VB.net class

2 REPLIES 2
Reply
Message 1 of 3
ralstogj
633 Views, 2 Replies

Autocad not seeing Command Methods in new VB.net class

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/
2 REPLIES 2
Message 2 of 3
ralstogj
in reply to: ralstogj

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/
Message 3 of 3
chiefbraincloud
in reply to: ralstogj

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost