.NET

Reply
Valued Contributor
ryan
Posts: 58
Registered: ‎11-30-2005
Message 1 of 13 (52 Views)

Help starting out

52 Views, 12 Replies
12-14-2006 03:30 PM
Hi all.

I've been programming in lisp for some time and thought I'd try out .NET. I'm having a little trouble at a grass-roots level though. I've found some tutes and set up Vis Studio accordingly though when I try to run a very simple program I'm getting errors. Can anyone tell me if the problem is in the code or somewhere in the setup?
I keem getting an acad error - no known command "helloworld".

Thanks in advance,

Ryan.

My code:

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput

Public Class Class1

< CommandMethod("helloworld") > _
Public Sub helloworld()
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
ed.WriteMessage("Hello World")

End Sub

End Class
*Norman Yuan
Message 2 of 13 (52 Views)

Re: Help starting out

12-14-2006 03:47 PM in reply to: ryan
It is most likely caused by incompatible VS and Acad. Which version of VS
(or VB.NET) and which version of Acad are you using?

wrote in message news:5426763@discussion.autodesk.com...
Hi all.

I've been programming in lisp for some time and thought I'd try out .NET.
I'm having a little trouble at a grass-roots level though. I've found some
tutes and set up Vis Studio accordingly though when I try to run a very
simple program I'm getting errors. Can anyone tell me if the problem is in
the code or somewhere in the setup?
I keem getting an acad error - no known command "helloworld".

Thanks in advance,

Ryan.

My code:

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput

Public Class Class1

< CommandMethod("helloworld") > _
Public Sub helloworld()
Dim ed As Editor =
Application.DocumentManager.MdiActiveDocument.Editor
ed.WriteMessage("Hello World")

End Sub

End Class
Valued Contributor
ryan
Posts: 58
Registered: ‎11-30-2005
Message 3 of 13 (52 Views)

Re: Help starting out

12-14-2006 04:27 PM in reply to: ryan
ACAD 2007 and VS2005.
Contributor
Chumplybum
Posts: 25
Registered: ‎12-15-2003
Message 4 of 13 (52 Views)

Re: Help starting out

12-14-2006 09:11 PM in reply to: ryan
your code works fine for me...

are you loading the application into AutoCAD??? if not, the NETLOAD command loads assemblys into autocad
Valued Contributor
ryan
Posts: 58
Registered: ‎11-30-2005
Message 5 of 13 (52 Views)

Re: Help starting out

12-14-2006 10:25 PM in reply to: ryan
Thanks for the reply Mark.

Yeah, I'm using NETLOAD, but having no luck. Is there an alternative to netload for loading a .NET dll?

I assumed the code would work - it was basically cut-and-paste from a tute I was following. That's why I wondered if it was something wrong with the VS set-up. is there a way to check that it's all set up properly?
*Paul Richardson
Message 6 of 13 (52 Views)

Re: Help starting out

12-15-2006 03:53 AM in reply to: ryan
Is this during debugging? You need to set the 'copylocal'
property to false for acmgd.dll.

wrote in message news:5426763@discussion.autodesk.com...
Hi all.

I've been programming in lisp for some time and thought I'd try out .NET.
I'm having a little trouble at a grass-roots level though. I've found some
tutes and set up Vis Studio accordingly though when I try to run a very
simple program I'm getting errors. Can anyone tell me if the problem is in
the code or somewhere in the setup?
I keem getting an acad error - no known command "helloworld".

Thanks in advance,

Ryan.

My code:

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput

Public Class Class1

< CommandMethod("helloworld") > _
Public Sub helloworld()
Dim ed As Editor =
Application.DocumentManager.MdiActiveDocument.Editor
ed.WriteMessage("Hello World")

End Sub

End Class
Valued Contributor
ryan
Posts: 58
Registered: ‎11-30-2005
Message 7 of 13 (52 Views)

Re: Help starting out

12-15-2006 04:41 AM in reply to: ryan
Thanks Paul.
Yes, during debugging. I didn't realise I needed to set 'copylocal' to false. Pardon my ignorance, but how would I do that?
Thanks,
Ryan.
*Paul Richardson
Message 8 of 13 (52 Views)

Re: Help starting out

12-15-2006 05:48 AM in reply to: ryan
Solution Explorer -> References -> Select 'acmgd.dll'
Properties -> 'Copy Loal' = False

wrote in message news:5427111@discussion.autodesk.com...
Thanks Paul.
Yes, during debugging. I didn't realise I needed to set 'copylocal' to
false. Pardon my ignorance, but how would I do that?
Thanks,
Ryan.
Valued Contributor
ryan
Posts: 58
Registered: ‎11-30-2005
Message 9 of 13 (52 Views)

Re: Help starting out

12-17-2006 01:34 PM in reply to: ryan
Nope. That's not the answer either. I'm still getting the "unknown command" error.
Any other ideas?
Distinguished Contributor
gilseorin
Posts: 177
Registered: ‎09-05-2006
Message 10 of 13 (52 Views)

Re: Help starting out

12-17-2006 02:28 PM in reply to: ryan
You should correct your problem by making a template file.
Get a source file provided by Autodesk comapany.
And then excute after setting debugger with acad.exe.
If the command working properly, you can make template file.
Then, the template file will be set all properly, but setting debugger with acad.exe. I hope, helped.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.