TheSwamp
Code Red => .NET => Topic started by: csharpbird on November 17, 2011, 10:05:32 AM
-
Table tb=new Table();
......
tb.SetBlockTableRecordId(i, 3, bt["Door"], true);
If "Door" block is normal,the table cell will get the block image.
If "Door" block is dynamic, AutoCAD will throw an exception.
-
Table tb=new Table();
......
tb.SetBlockTableRecordId(i, 3, bt["Door"], true);
If "Door" block is normal,the table cell will get the block image.
If "Door" block is dynamic, AutoCAD will throw an exception.
What AutoCAD version? What error message? What about a complete code example to reproduce your observation? Did you read Kean's blog (http://through-the-interface.typepad.com/through_the_interface/2011/10/creating-a-legend-of-autocad-drawings-using-net.html) and did you try the syntax he uses, as follows?
// Insert the block as the contents of our cell
Cell cell = tb.Cells[row, col];
cell.Contents.InsertAt(0);
cell.Contents[0].BlockTableRecordId =
blockId;
-
I'm using AutoCAD 2008.
It seems that your code is not for this version.
-
I'm using AutoCAD 2008.
It seems that your code is not for this version.
The Table API underwent a major restructuring with release 2010. I'd wager a guess that the kind of problem you observed might have had something to do with it, even when the dynamic block API had stabilized before that.