.NET
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
AutoCad201 0 with Visualstud io-2008 (c#)
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
329 Views, 4 Replies
04-26-2012 04:17 AM
Hi All,
I tried to write a simple program in c#.net for autocad 2010.
I build and loaded the .dll file but not able to access the command.
When i type tst in command prompt, it prompting unknown command.
Please help me how to solve this.
using System;
using System.Collections.Generic;
using System.Text;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data;
namespace AcadGlobles
{
class Commands
{
[CommandMethod("tst")]
static public void test()
{
MessageBox.Show("hi");
}
}
}
Thanks,
Kumar.
Solved! Go to Solution.
Re: AutoCad201 0 with Visualstud io-2008 (c#)
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-26-2012 05:08 AM in reply to:
giskumar
Re: AutoCad201 0 with Visualstud io-2008 (c#)
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-26-2012 06:34 AM in reply to:
giskumar
The class Commands needs to be public. Not sure if it matters, but normally the public is the first item listed, so instead of
static public void test()
it woul be
public static void test()
Jeff_M, also a frequent Swamper
Re: AutoCad201 0 with Visualstud io-2008 (c#)
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-26-2012 08:32 AM in reply to:
giskumar
Like Jeff said, the method and the class must be public, otherwise AutoCAD will not locate the method
class Commands
should be replaced with
public class Commands
Regards,
Augusto Goncalves
Autodesk Developer Network
Augusto Goncalves
Autodesk Developer Network
Re: AutoCad201 0 with Visualstud io-2008 (c#)
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-26-2012 09:30 PM in reply to:
giskumar
Hi All,
Thanks for the reply.
Adding Public before class is working for me.
Regards,
Kumar.



