.NET

Reply
Valued Contributor
sepich4567
Posts: 53
Registered: ‎07-18-2005
Message 1 of 5 (380 Views)

Unknown command

380 Views, 4 Replies
08-10-2005 04:59 PM
My program compiles with 0 errors and 0 warnings however when I load with netload and run AutoCAD tells me "unknown command" What is the problem?
*Tony Tanzillo
Message 2 of 5 (380 Views)

Re: Unknown command

08-10-2005 06:20 PM in reply to: sepich4567
Try making the Create function static (Shared in VB).

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4925522@discussion.autodesk.com...
My program compiles with 0 errors and 0 warnings however when I load with netload and run AutoCAD tells me "unknown command" What is the problem?
*Mike Tuersley
Message 3 of 5 (380 Views)

Re: Unknown command

08-10-2005 09:44 PM in reply to: sepich4567
You also may need to make it a SUB. I don't believe you can call a FUNCTION
since function implies a return value. Change it to this and it'll work:

Public Class EmployeeObject
_
Public Shared Sub Create()

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Maksim Sestic
Message 4 of 5 (380 Views)

Re: Unknown command

08-10-2005 11:42 PM in reply to: sepich4567

Mike,

 

Function is OK. Here's a piece of code that
works:

 


face="Courier New">Imports
color=#000000>
System.Runtime.InteropServices


face="Courier New" color=#0000ff size=2>Imports

face="Courier New" color=#000000> Autodesk.AutoCAD.Runtime

 

Public
size=2>
Class
DemoClass


size=2>Implements

Autodesk.AutoCAD.Runtime.IExtensionApplication

 


size=2>Public

size=2>Sub
Initialize()
size=2>Implements

Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize


size=2>Autodesk.AutoCAD.ApplicationServices.CommandLinePrompts.Message(vbNewLine
+ _


size=2>"DEMO Class successfully loaded..." +
vbNewLine)


size=2>End

size=2>Sub


size=2>
 


size=2>Public

size=2>Sub
Terminate()
size=2>Implements

Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate


size=2>End

size=2>Sub

 


size=2><Autodesk.AutoCAD.Runtime.CommandMethod("DEMO1")>
_


size=2>Public

size=2>Function
Demo1()

...


color=#0000ff size=2>End

color=#0000ff size=2>Function


face="Courier New">End
size=2>

size=2>Class

 

Sepich, you need to
load resulting DLL via AutoCAD's NETLOAD command. Also try to keep a DLL at
location found in AutoCAD's Search/Support Path (or create a new
one).

 

Regards,

Maksim Sestic

 

 

You also may need to make it a
SUB. I don't believe you can call a FUNCTION
since function implies a return
value. Change it to this and it'll work:

Public Class
EmployeeObject
<CommandMethod("create")> _
Public Shared Sub
Create()

-- Mike
___________________________
Mike
Tuersley
___________________________
the trick is to realize that there is
no spoon...
*Mike Tuersley
Message 5 of 5 (380 Views)

Re: Unknown command

08-11-2005 07:07 AM in reply to: sepich4567
Thanks Maksim. I knew that would work but I'm not sure if it does if you
remove your Initialize sub. Easy enough to test, I just haven't had much
time to play lately ;-)

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
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 or visit the Installation and Licensing Forum to get help installing your software.