几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(VB.NET/C#) (http://www.dimcax.com/hust/forumdisplay.php?f=176)
-   -   怎么在模形空间中读取xdata (http://www.dimcax.com/hust/showthread.php?t=9668)

yang686526 2009-04-21 12:35 PM

怎么在模形空间中读取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.