- UID
- 681698
- 积分
- 394
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2013-7-14
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
由于时间仓促,本程序未经调试,希望大家提出宝贵意见。最近比较忙,好久没来论坛了。
- void PostToModelSpace(AcDbEntity *pEnt)//添加实体到模型空间
- {
- AcDbBlockTable *pBlkTbl;
- acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlkTbl,AcDb::kForRead);
- AcDbBlockTableRecord *pBlkTblRcd;
- pBlkTbl->getAt(ACDB_MODEL_SPACE,pBlkTblRcd,AcDb::kForWrite);
- pBlkTbl->close();
- AcDbObjectId entId;
- pBlkTblRcd->appendAcDbEntity(entId,pEnt);
- pEnt->close();
- pBlkTblRcd->close();
- }
- // - XsdkArxProject3.HUAN command (do not rename)
- static void XsdkArxProject3HUAN(void)
- {
- // Add your code for command XsdkArxProject3.HUAN here
- ads_name ss,s1;
- struct resbuf *rb = acutBuildList(RTDXF0,L"LWPOLYLINE",RTNONE);
- if (acedSSGet(NULL,NULL,NULL,rb,ss)!=RTNORM)
- {
- return;
- }
- long len;
- if (RTNORM==acedSSLength(ss,&len))
- {
- for (int i = 0; i < len; i++)
- {
- acedSSName(ss,i,s1);
- AcDbObjectId id;
- acdbGetObjectId(id,s1);
- AcDbPolyline *pPline ;
- acdbOpenObject(pPline,id,AcDb::kForWrite);
- AcGePoint2dArray ptArray;
- for (int j = 0; j < pPline->numVerts(); j++)
- {
- AcGePoint2d p2d; pPline->getPointAt(j,p2d);
- ptArray.append(p2d);
- }
- ptArray = ptArray.reverse();
- AcDbPolyline *pNewPoly = new AcDbPolyline(ptArray.length());
- for (int k = 0; k < ptArray.length(); k++)
- {
- AcGePoint2d p2d1 = ptArray.at(k);
- pNewPoly->addVertexAt(k,p2d1);
- }
- pNewPoly->setPropertiesFrom(pPline);
- pNewPoly->setXData(pPline->xData());
- PostToModelSpace(pNewPoly);
- pPline->erase();
- pPline->close();
- }
- }
- acedSSFree(ss);
- acutRelRb(rb);
- }
|
|