I need to create the circle from my button click via process dll(Acdbmgd.dll ,acmgd.dll)
.
I am able to create the circle via COM interop dll. But i don't know how to create the Circle using process dll
.
Here is the sample code:
Database db = HostApplicationServices.WorkingDatabase;
Document doc = Autodesk.AutoCAD.ApplicationServices.
Application.DocumentManager.GetDocument(db);
// Perform our addition
double res = 5 + 9;
// Lock the document before we access it
DocumentLock loc = doc.LockDocument();
using (loc)
{
Transaction tr = db.TransactionManager.StartTransaction();
using (tr)
{
// Create our circle
Circle cir =
new Circle(new Point3d(0, 0, 0), new Vector3d(0, 0, 1), res);
cir.SetDatabaseDefaults(db);
// Add it to the current space
BlockTableRecord btr = (BlockTableRecord)tr
.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
btr.AppendEntity(cir);
tr.AddNewlyCreatedDBObject(cir, true);
// Commit the transaction
tr.Commit();
}
}
While i execute above code in button click means in runtime error throws like "The specified module could not be found".
But if i create one separate dll then i refer that dll in my project and create object for that means it's working
But i need to run the code in debug mode so i need to work with exe.Is there anyway to do via exe?
Thanks in advance..