![]() |
【转帖】如何使选择对象高亮显示
如何使选择对象高亮显示
如何使选择对象高亮显示 如何使选择对象高亮显示啊,请大侠们多多指点! 你是想别你给你程序编好是吧,这就象天上掉金子-不大可能 acad::errorstatus m_mesh_dxywyg::getobjectandgsmarker(acdbobjectid& objid,int& marker) { ads_name m_arc; if(acedssget("_:s",null,null,null,m_arc)!=rtnorm){ acutprintf("\nacedssget 函数调用失败"); return::acad::einvalidadsname; } else { struct resbuf *prb; if(acedssnamex(&prb,m_arc,0)!=rtnorm){ acedssfree(m_arc); return::acad::eambiguousoutput; } else { acedssfree(m_arc); ///////////////////////////////////////////// struct resbuf *ptemp; int i; for(i=1,ptemp=prb;i<3;i++,ptemp=ptemp->rbnext) {;} ads_name ename; ads_name_set(ptemp->resval.rlname,ename); ptemp=ptemp->rbnext; marker=ptemp->resval.rint; acutrelrb(prb); acdbgetobjectid(objid,ename); } return acad::eok; } //return acad::eok; } ///////////////////////////////////////////////////////////////高亮显示选择实体。 void m_mesh_dxywyg::highlightall(const acdbobjectid& objid) { // acgepoint3d pt1; acdbarc *arc1; // acdbarc::center(objid); char dummy[133]; acdbentity *pent; acdbopenacdbentity(pent,objid,acdb::kforread); arc1=(acdbarc*)pent; pent->highlight(); acedgetstring(0,"\n确定要划分该圆弧[enter]...", dummy); //////////////////////////////////////////////////////////// ////////////////////////////////////////获取选择圆弧的参数,并且把圆弧的参数赋给节点类中的变量 ana_mesh m_femnode; pt1=arc1->center(); radius=arc1->radius(); stattangle=arc1->startangle(); endangle=arc1->endangle(); ////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// pent->close(); } bool m_mesh_dxywyg::meshselect() { // todo: add your control notification handler code here begineditorcommand(); acdbobjectid objid; int marker; if(getobjectandgsmarker(objid,marker)==acad::eok) { highlightall(objid); completeeditorcommand(); return true; } else { completeeditorcommand(); return false; } } 本人编写的,可以参考看看 呵呵 好样的啊!感谢 其实看重点函数 pent->highlight(); 就可以了 谢谢,大家 由于接触arx还不久,很多东西不会用。希望懂的同志多多指教,高手指点的透彻一点,我们这些菜鸟可能会节约很多时间,受益匪浅。无论大家表示支持或批评,我都虚心接受。 我也是初学者,希望以后多多指教。 |
所有的时间均为北京时间。 现在的时间是 09:57 AM. |