![]() |
怎么在模形空间中读取xdata
怎么在模形空间中读取xdata
www.dimcax.com 怎么在模形空间中读取xdata _ public shared sub getxdata() dim db as database = application.documentmanager.mdiactivedocument.database dim tm as dbtransman = db.transactionmanager dim ed as autodesk.autocad.editorinput.editor = _ application.documentmanager.mdiactivedocument.editor dim myt as transaction = tm.starttransaction() dim rec as new xrecord() dim bt as blocktable = myt.getobject(db.blocktableid, openmode.forread) dim btr as blocktablerecord = myt.getobject(bt(blocktablerecord.modelspace), openmode.forread) rec.xdata = btr.getxdataforapplication("appname") dim rb as typedvalue for each rb in rec.xdata.asarray() ed.writemessage(string.format("typecode={0}, value={1}" + controlchars.lf, rb.typecode, rb.value)) next rb end sub 问题已经解决了,刚学objectarx,不知道这个数据结构,原来我以前的vba程序是把扩展数据加载在模型空间,现在已经明白了,谢谢版主! [ 。。。。。。。。。。 xdata数据是和具体的对象关联的吧。可以使用entity.xdata获取 |
所有的时间均为北京时间。 现在的时间是 02:16 PM. |