我需要插入一个AcadBlockReference
into AcadTable
,但是我的 blockObjectId
属性有一个错误。
//*****************Sample Code*************************************
AcadApplication gbl_app = null;
AcadDocument gbl_doc = null;
AcadLayout presentacion = null;
AcadTable tablaAcad = null;
gbl_app = (AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");
gbl_doc = gbl_app.ActiveDocument;
object AC_entidad = new object();
object basePnt2 = null;
gbl_doc.Utility.GetEntity(out AC_entidad, out basePnt2, "Seleccione objeto:");
AcadBlockReference objBlock = (AcadBlockReference)AC_entidad;
bloqueId = objBlock.ObjectID;
double[] vertices = new double [3];
vertices[0] = 49.24;
vertices[1] = 155;
vertices[2] = 0;
tablaAcad = gbl_doc.ActiveLayout.Block.AddTable(vertices, 4, 2, 3, 10);
tablaAcad.SetCellTextHeight(0, 0, 2);
tablaAcad.SetTextHeight(5, 1.5);
tablaAcad.SetColumnWidth(0, 5);
tablaAcad.SetColumnWidth(1, 50);
tablaAcad.SetBlockTableRecordId(3, 0, bloqueId , true);
错误:无效类