几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】c#.net关于用-boundary命令填充用程序实现的问题,已找到方法 (http://www.dimcax.com/hust/showthread.php?t=8810)

yang686526 2009-04-20 09:50 AM

【转帖】c#.net关于用-boundary命令填充用程序实现的问题,已找到方法
 
c#.net关于用-boundary命令填充用程序实现的问题,已找到方法
www.dimcax.com
c#.net关于用-boundary命令填充用程序实现的问题,已找到方法
, ,
一般地,在lisp和c++arx中,这都不算问题。但c#.net中,就要采用曲线办法了。 大体方法是: 1、设置全局变量 public static boolean ishatch = false; 设置全局变量 public static string commstr = “”; public static document document = application.documentmanager.mdiactivedocument.editor.document ; 2、建立要运行的命令 【method(“test”)】 public void testuseboundary { …… //取得插入点 point3d pt3 = presult.vaule; //建立命令字符串 commstr = “-boundary ” + pt3.x.tostring() + "," + pt3.y.tostring() + " " + "\n"; //设置 ishatch = true; //建立反应器 document.commandended += new commandeventhandler(document_commandended); } //反应器 void document_commandended(object sender, commandeventargs e) { if (!ishatch) return; if (!e.globalcommandname.equals("-boundary", stringcomparison.ordinalignorecase)) { //发送命令 document.sendstringtoexecute(xdatas, false, false, false); } else { ishatch = false; //取消反应器 document.commandended -= new commandeventhandler(document_commandended); acedredraw(null, 1); promptselectionresult ss = application.documentmanager.mdiactivedocument.editor.selectlast(); if (ss.status != promptstatus.ok) return; if (ss.value.count == 0) return; objectid pid = ss.value.getobjectids()[0]; //检查得到的实体是否有boundary命令生成 if (!checkpolylinefromboundary(pid)) return; //开始填充符号 cass_hatchinbox(pid); } } //我通过两天的努力,终于有收获,这里与大家共享。使用效果还可以
看看先
路过来顶啦
不是个好办法
楼上的,把你的好方法贴出来看咯
学如逆水行舟,不进则退!


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