几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   为什么实体不可见,但存盘重新打开文件后可见 (http://www.dimcax.com/hust/showthread.php?t=9263)

yang686526 2009-04-20 05:51 PM

为什么实体不可见,但存盘重新打开文件后可见
 
为什么实体不可见,但存盘重新打开文件后可见
www.dimcax.com
为什么实体不可见,但存盘重新打开文件后可见
我在模型空间添加了一个实体,但程序运行完后看不见该实体,用cad命令erase删除时,用all方式选择实体,从选中的实体个数看,该实体可选中,但如果用window框选、无论window框范围多大,无论从从右往左,还是从左往右,都选不中该实体,因为命令行提示的选中个数比all选择方式少一个。程序代码大概如下,请高手指点,不甚感激 editor ed = autodesk.autocad.applicationservices.application.documentmanager.mdiactivedocument.editor; try { database db = hostapplicationservices.workingdatabase; using (transaction trans = db.transactionmanager.starttransaction()) { blocktable bt = (blocktable)trans.getobject(db.blocktableid, openmode.forread); blocktablerecord btr = (blocktablerecord)trans.getobject(bt[blocktablerecord.modelspace], openmode.forwrite); //ent.layer = globalvalues.layername; //ent.linetype = globalvalues.linetypename; ent.color = color.fromcolorindex(colormethod.byaci,3); //ent.linetypescale = globalvalues.scalenumber; ent.visible = true; ent.highlight(); btr.appendentity(ent); trans.addnewlycreateddbobject(ent, true); trans.commit(); trans.dispose(); } return ent.objectid; } catch (autodesk.autocad.runtime.exception ex) { ed.writemessage(ex.message); return objectid.null; } }
操作完以后 cad 添加实体后 是不会自动显示的 发送命令 z e 就可以了
z e 命令没用的 对于你这种情况,你添加实体后 调用一下 editor.updatescreen 看看 ,如果还不行 你调用一下 regen 命令看看。我 还出现过 从一个 文件中拷贝图形到 新建的一个文件中后 显示不出来的情况,也不知道是啥原因。


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