.NET

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

Error in InsertBlock

79 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.