几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】如何实现xref功能 (http://www.dimcax.com/hust/showthread.php?t=9517)

yang686526 2009-04-21 09:55 AM

【转帖】如何实现xref功能
 
如何实现xref功能
www.dimcax.com
如何实现xref功能
我想在程序中通过外部引用实现xref功能,把已有的图框引用到我的新图中,除采用命令方式外如何实现?
.net里xref方面的好像功能不太完整
c#最适合开发autocad,因为它拥有vb容易的特点,却具有vc++的强大功能。
已解决,database中有attachxref方法
楼主能否给个xref的例子
插入一个“tk.dwg“图框文件,返回id public function createtkxref() as objectid dim newentid as objectid dim db as database = hostapplicationservices.workingdatabase() using trans as transaction = db.transactionmanager.starttransaction() dim bt as blocktable = trans.getobject(db.blocktableid, openmode.forwrite) dim btr as blocktablerecord = trans.getobject(bt(comspace), openmode.forwrite) dim objid as objectid try objid = db.attachxref("tk.dwg", "tk") dim br as new blockreference(new point3d(10, 10, 0), objid) btr.appendentity(br) 'add the reference to modelspace trans.addnewlycreateddbobject(br, true) 'let the transaction know about it catch ex as exception 'application.documentmanager.mdiactivedocument.editor.writemessage("没有找到tk.dwg") end try trans.commit() trans.dispose() end using return newentid end function


所有的时间均为北京时间。 现在的时间是 05:48 AM.