.NET

Reply
Valued Contributor
Prakashdotc
Posts: 88
Registered: ‎03-03-2006
Message 1 of 1 (77 Views)

Error in InsertBlock

77 Views, 0 Replies
04-26-2006 11:46 PM
Hi All,

Here's my code,

Autodesk.AutoCAD.Interop.AcadApplicationClass app = new Autodesk.AutoCAD.Interop.AcadApplicationClass();

Autodesk.AutoCAD.Interop.AcadDocument doc = app.ActiveDocument;

Autodesk.AutoCAD.Interop.Common.AcadBlock block = doc.Blocks.Add(new double[] {0,0,0},"Sam");

block.AddLine(new double[] {1,1,0},new double[] {10,10,0});

doc.SaveAs("c:\\Sam.dwg",Autodesk.AutoCAD.Interop.Common.AcSaveAsType.acR15_dwg,new Autodesk.AutoCAD.DatabaseServices.SecurityParameters());

double[] InsertPoint = new double[2];
InsertPoint[0] = 5;
InsertPoint[1] = 5;
InsertPoint[2] = 0;

block.InsertBlock(InsertPoint,"c:\\Sam.dwg",1,1,1,0,"");

I'm getting error in the final line - 'block.InsertBlock(InsertPoint,"c:\\Sam.dwg",1,1,1,0,"");' - can anyone rectify my problem, thank's in advance

Prakash.C
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.