几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】源程序:用arx.net将dwg文件以块的方式插入cad中 (http://www.dimcax.com/hust/showthread.php?t=9903)

yang686526 2009-04-21 04:51 PM

【转帖】源程序:用arx.net将dwg文件以块的方式插入cad中
 
源程序:用arx.net将dwg文件以块的方式插入cad中
www.dimcax.com
源程序:用arx.net将dwg文件以块的方式插入cad中
public class testinsert { [commandmethod("testinsert")] static public void doit() { document doc = application.documentmanager.mdiactivedocument; editor ed = doc.editor; promptresult res = ed.getstring("give me a file to insert"); if (res.status != promptstatus.ok) return; string fname = res.stringresult; if (!file.exists(fname)) fname = hostapplicationservices.current.findfile(fname, doc.database, findfilehint.default); using (database db = new database(false, false)) { //read drawing db.readdwgfile(fname, fileshare.read, true, null); using (transaction t = doc.transactionmanager.starttransaction()) { //insert it as a new block objectid idbtr = doc.database.insert("test", db, false); //create a ref to the block blocktable bt = (blocktable)t.getobject(doc.database.blocktableid, openmode.forread); blocktablerecord btr = (blocktablerecord)t.getobject(bt[blocktablerecord.modelspace], openmode.forwrite); using (blockreference bref = new blockreference(point3d.origin, idbtr)) { btr.appendentity(bref); t.addnewlycreateddbobject(bref, true); } t.commit(); } } } } 请问各位大侠,在这个基础上加一个将块打碎的功能应该用什么函数?谢谢
使用blockreference的explodetoownerspace属性


所有的时间均为北京时间。 现在的时间是 01:46 PM.