![]() |
【转帖】c#中如何插入多行文本?谢谢
c#中如何插入多行文本?谢谢
c#中如何插入多行文本?谢谢 我想实现cad多行文本的功能,指定多行文本顶端和末端的位置,然后设置字体大小,对齐方式.然后输入要显示的字,高手们这个能指点一下,吗?帮点小忙吧,小弟在次谢过了! c++的话,acdbmtext,至于c#找一下sdk对应的类,new出来,设置一下参数,加入数据库就行了,应该不难。 谢谢我知道了 database db = application.documentmanager.mdiactivedocument.database; dbtransman tm = db.transactionmanager; mtext txt = new mtext(); txt.contents = "123\r\n456\r\n测试"; using(transaction ta = tm.starttransaction()) { blocktable bt = (blocktable)tm.getobject(db.blocktableid, openmode.forread); objectid objid; editor ed = application.documentmanager.mdiactivedocument.editor; if (bt.has("a010001")) { objid = bt["a010001"]; blocktablerecord btr = (blocktablerecord)tm.getobject(objid, openmode.forwrite); btr.appendentity(txt); tm.addnewlycreateddbobject(txt, true); ed.writemessage(btr.name + " --- renaud"); ta.commit(); } else { ed.writemessage("not has --- renaud"); } } |
所有的时间均为北京时间。 现在的时间是 06:53 AM. |