autocad的二次开发中表格操作的问题
www.dimcax.com
autocad的二次开发中表格操作的问题
请教如何在visualstuio
<commandmethod("creattable")> _
public sub ceattable()
try
dim prpointres as promptpointresult = ed.getpoint("选择插入点")
dim blktbl as blocktable = ctype(trans.getobject(db.blocktableid, openmode.forread), blocktable)
dim blktblrec as blocktablerecord = ctype(trans.getobject(blktbl(blocktablerecord.modelspace), openmode.forwrite), blocktablerecord)
'dim stid as objectid = acadtableutilities.maketablestyle
dim ptable as new table
with ptable
.position = prpointres.value
.numcolumns = 5 '5列
.numrows = 33 '33行
'初始化表格ptable
.isheadersuppressed = true '去掉页眉
.istitlesuppressed = true '去掉标题行
.setcolumnwidth(0, 900)
.setcolumnwidth(1, 6400)
.setcolumnwidth(2, 4400)
.setcolumnwidth(3, 4400)
.setcolumnwidth(4, 1900)
.setrowheight(700) '行高700
for j = 0 to 32
.settextheight(j, 0, 300)
.setalignment(j, 0, cellalignment.middlecenter)
.settextheight(j, 1, 400)
.setalignment(j, 1, cellalignment.middleleft)
.settextheight(j, 2, 300)
.setalignment(j, 2, cellalignment.middlecenter)
.settextheight(j, 3, 400)
.setalignment(j, 3, cellalignment.middlecenter)
.settextheight(j, 4, 300)
.setalignment(j, 4, cellalignment.middlecenter)
next
end with
blktblrec.appendentity(ptable)
trans.addnewlycreateddbobject(ptable, true)
ptable.recomputetableblock(true)
'ed.regen()
ptable.dispose()
blktbl.dispose()
blktblrec.dispose()
catch ex as system.exception
msgbox(ex.stacktrace)
end try
trans.commit()
trans.dispose()
end sub
学习!!!致敬!!!!