几何尺寸与公差论坛------致力于产品几何量公差标准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=9808)

yang686526 2009-04-21 02:53 PM

无法实现画剖面图案?
 
无法实现画剖面图案?
www.dimcax.com
无法实现画剖面图案?
你解决了没?我也要做等高线上的剖面,是否可以跟你交流下阿
帮你调试了一下,只要把hatch类的所有函数放在 btr.appendentity(hch)之前,而hatch类的所有属性放在trans.addnewlycreateddbobject(hch, true)之后,这样就可以了。下面是我的代码,调试下来没有任何问题: [vb] public sub hch() trans = db.transactionmanager.starttransaction dim bt as blocktable = trans.getobject(db.blocktableid, openmode.forread) dim btr as blocktablerecord = trans.getobject(bt("*model_space"), openmode.forwrite) dim p as point3d = point3d.origin, ids as objectidcollection = new objectidcollection dim pl as polyline = pljxcent(p, 5000, 5000) '--自定义的画矩形的函数(在模型空间),经过长期考验,没有问题 ids.add(pl.objectid) dim hch as hatch = new hatch hch.sethatchpattern(hatchpatterntype.predefined, "solid") hch.appendloop(hatchlooptypes.default, ids) hch.evaluatehatch(true) btr.appendentity(hch) trans.addnewlycreateddbobject(hch, true) hch.associative = true 'hch.patternscale = 1000 trans.commit() : trans.dispose() end sub[/vb]
c#最适合开发autocad,因为它拥有vb容易的特点,却具有vc++的强大功能。


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