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

Error in InsertBlock

83 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.