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

Error in InsertBlock

75 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;


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


You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community