The only way to use the AutoCAD Managed API is
from a DLL that is loaded into AutoCAD using the
NETLOAD command.
You must create a new ClassLibrary project, and
then use the NETLOAD command to load it.
The equivalent of the 'Main()' entry point, is the
IExtensionApplication.Initialize method, or you
can define a with the [CommandMethod] attribute,
and enter the command to run your code.
You should download and look at the examples
that ship with the ObjectARX API first.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
wrote in message news:5664672@discussion.autodesk.com...
Hello,
I'm trying with this simple code:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.PlottingServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using System.Collections.Specialized;
namespace ACADConverter
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Starting Plot");
try
{
Database db = new Database(false, true);
db.ReadDwgFile("c:\\caddo.dwg", FileShare.Read, true, null);
}
catch (FileNotFoundException fnfe)
{
Console.WriteLine("Errore: " + fnfe.StackTrace);
}
}
}
}
But I got this error:
Unhandled Exception: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at ACADConverter.Program.Main(String[] args)
I had imported this libs:
-acdbmgd
-acmgd
-System
-System.Drawing
-System.Xml
I use AutoCAD 2007
Thank you.
Alfredo