.NET

Reply
Valued Contributor
kcimos
Posts: 81
Registered: ‎02-18-2010
Message 1 of 3 (200 Views)

vb.net routine - autocad says unkown command

200 Views, 2 Replies
03-03-2012 02:46 PM

I have no idea why autocad 2012 refuses to load this, or it is loading it but something else is causing the command to not be known.

 

I have no errors in visual studio & I get no errors when I netload.

I'm sure there are logic errors since I haven't been able to debug this yet (migrating it from VBA to VB.NET)

 

any help would be appreciated.

 

the start point / command is in Class2 in vbLayerGroupController

 

ACF & ACGen contain functions called by my routine.

 

While trying to figure this out, as a test, I had created a new class with a generic msgbox command within this project & it worked (I removed it now), so there is something in here that autocad doesn't like.

 

*Expert Elite*
norman.yuan
Posts: 961
Registered: ‎04-27-2009
Message 2 of 3 (188 Views)

Re: vb.net routine - autocad says unkown command

03-03-2012 06:47 PM in reply to: kcimos

In your class2.vb file, add this line after the "Imports..." instruction and before the class LayerGroupController, like this:

 

Imports Autodesk...

Imports .....

 

<Assembly: CommandClass(GetType(LayerGroupController))>

 

Class LayerGroupController

    ...

    <CommandMethod("LKK")>_

    Public Sub LayerGroupController()

        .....

    End Sub

    ....

 

EndClass

 

HTH

 

Valued Contributor
kcimos
Posts: 81
Registered: ‎02-18-2010
Message 3 of 3 (183 Views)

Re: vb.net routine - autocad says unkown command

03-03-2012 08:08 PM in reply to: norman.yuan

that worked.

what is it? why?

I don't have that in any other projects that work.

 

thanls.

 

I would have NEVER figured that out.

 

also, useful tip for anyone out there (maybe):

I set option strict  = ON, & a lot of errors revealed themselves.

I've been leaving it off because there always ends up being at least one thing I can't resolve, like with this program there was one late binding error (keep in mind I haven't begun to debug this yet since I haven't yet been able to enter my command in autocad to start the process):

 

...

                   

ForEach Ent AsObjectInACF.ThisDrawing.PaperSpace

If Ent.ObjectName = "AcDbViewport"Then

....

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community