- UID
- 341
- 积分
- 1118
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-11
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- bool oxaReversePolyline(ads_name entname)
- {
- char *strGet=new char[32];
- AcDbObjectId idPline;
- if (acdbGetObjectId(idPline, entname)!=Acad::eOk)
- {
- return ;//false;
- }
- AcDbEntity* pEnt;
- if(Acad::eOk!=acdbOpenAcDbEntity(pEnt, idPline, AcDb::kForWrite))
- {
- return ;//false;
- }
-
- //判断是不是曲线
- AcDbPolyline *cvPLine=AcDbPolyline::cast(pEnt);
- if (cvPLine==NULL)//acutPrintf("\n 选择的不是Polyline ");
- {
- pEnt->close();
- return ;//false;
- }
- //
- unsigned int uiNumberTotal=cvPLine->numVerts();
- unsigned int uiNumber=uiNumberTotal/2; // 折半,通过整数相除舍去余数
- uiNumberTotal--; //修正之,因为index起点是0
-
- AcGePoint2d ptFront, ptBack;
- double dBulgeFront, dBulgeBack;
- for(unsigned int index=0;index<uiNumber;index++)
- {
- cvPLine->getPointAt(index,ptFront);
- cvPLine->getBulgeAt(index+1,dBulgeFront);
- cvPLine->getPointAt(uiNumberTotal-index,ptBack);
- cvPLine->getBulgeAt(uiNumberTotal-index-1,dBulgeBack);
- acutPrintf("\n---fBulge=%f ,%f ,",dBulgeFront ,dBulgeBack);
-
- cvPLine->setPointAt(index,ptBack);
- cvPLine->setBulgeAt(index,-dBulgeBack);
- cvPLine->setPointAt(uiNumberTotal-index,ptFront);
- cvPLine->setBulgeAt(uiNumberTotal-index+1,-dBulgeFront);
- }
-
- cvPLine->close();
- pEnt->close();
- return ;//true;
- }
复制代码 |
|