TA的每日心情 | 开心 昨天 06:36 |
---|
签到天数: 15 天 [LV.4]偶尔看看III
管理员
- 积分
- 1308
|
- static void zffObjectARX_MyCommand18(void)
- {
- ads_name ss;
- acedSSGet(NULL,NULL,NULL,NULL,ss);
- long len;
- acedSSLength(ss,&len);
- double startAng,endAng;
- double radius;
- AcGePoint3d center;
- for (int i=0;i<len;)
- {
- AcDbArc* pArc=NULL;
- AcDbObjectId entId;
- ads_name name,name1;
- acedSSName(ss,i,name);
- acdbGetObjectId(entId,name);
- acdbOpenObject(pArc,entId,AcDb::kForWrite);
- double arcStartAng=pArc->startAngle();
- double arcEndAng=pArc->endAngle();
- if (arcEndAng==0)
- {
- arcEndAng+=2*pi();
- }
- AcGePoint3d arcCenter=pArc->center();
- double arcRadius=pArc->radius();
- radius=arcRadius;
- center=arcCenter;
- startAng=arcStartAng;
- endAng=arcEndAng;
- for (int j=i+1;j<len;)
- {
- AcDbArc* pArc1=NULL;
- acedSSName(ss,j,name1);
- acdbGetObjectId(entId,name1);
- acdbOpenObject(pArc1,entId,AcDb::kForWrite);
- double arc1StartAng=pArc1->startAngle();
- double arc1EndAng=pArc1->endAngle();
- if (arc1EndAng==0)
- {
- arc1EndAng+=2*pi();
- }
- AcGePoint3d arc1Center=pArc1->center();
- double arc1Radius=pArc1->radius();
- if (arcCenter==arc1Center && arcRadius==arc1Radius)
- {
- if (arc1StartAng<startAng)
- {
- startAng=arc1StartAng;
- }
- if (arc1EndAng>endAng)
- {
- endAng=arc1EndAng;
- }
- acedSSDel(name1,ss);
- pArc1->erase();
- acedSSLength(ss,&len);
- }
- else
- {
- j++;
- }
- pArc1->close();
- }
- acedSSDel(name,ss);
- pArc->erase();
- pArc->close();
- acedSSLength(ss,&len);
- AcDbArc* pArcRe=new AcDbArc(center,radius,startAng,endAng);
- AddToModelSpace(pArcRe);
- }
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|