Do you need to commit it to the transaction?
Under this line
tr.AddNewlyCreatedDBObject(myline1,true);
add this
tr.Commit();
--
Tim
"A blind man lets nothing block his vision."
wrote in message news:5607430@discussion.autodesk.com...
Hello All,
We trying to insert a Legend into our drawing after we run some hatch
reports. When I try to insert it progrmatically it does not show. Can anyone
tell me what we are doing wrong.
BlockTable bt1 = (BlockTable)tr.GetObject(db.BlockTableId,
OpenMode.ForRead);
BlockTableRecord btr1 =
(BlockTableRecord)tr.GetObject(bt1[BlockTableRecord.ModelSpace],
OpenMode.ForWrite);
Point3d TopLeft=new Point3d(1402,242,0);
Point3d BottomLeft=new Point3d(1402,107,0);
Point3d TopRight=new Point3d(1462,242,0);
Point3d BottomRight=new Point3d(1462,107,0);
Line myLine = new Line(TopLeft, TopRight);
Line myLine1 = new Line(TopRight, BottomRight);
myLine.Color = Color.FromColor(System.Drawing.Color.White);
myLine.Thickness = 2000;
myLine1.Color = Color.FromColor(System.Drawing.Color.White);
myLine1.Thickness = 2000;
btr1.AppendEntity(myLine);
btr1.AppendEntity(myLine1);
tr.AddNewlyCreatedDBObject(myLine, true);
tr.AddNewlyCreatedDBObject(myLine1, true);
db.SaveAs(TempString, DwgVersion.AC1800);
Thanks in advance.
- Jay Balapa