- 积分
- 358
- 明经币
- 个
- 注册时间
- 2005-2-2
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-6-8 10:21:00
|
显示全部楼层
FLOWERDLG dlg; CAcUiDialog::OnOK(); CDC*pDC=GetDC(); float radio=100; long step=dlg.m_nSTEP; int n=dlg.m_nN; CPoint point1,point2; point1.x=160; point2.y=140; float a=0;
for(float i=0;i<=720/step;i++){ point1.x=290+radio*cos(2*a*pi/360); point1.y=140+radio*sin(2*a*pi/360); point2.x=290+radio*cos(n*2*a*pi/360); point2.y=140+radio*sin(n*2*a*pi/360); a+=step; pDC->MoveTo(point1); pDC->LineTo(point2); }
//这是c本身的画法,cad中有自己的命令
AcDb2dPolyline *Newline1=new AcDb2dPolyline(AcDb::k2dQuadSplinePoly/*k3dSimplePoly*/,ptAr,mheight,Adesk::kFalse,lwidth,lwidth);
//取表名 AcDbBlockTable *pBTable1; acdbHostApplicationServices()->workingDatabase() ->getSymbolTable(pBTable1, AcDb::kForRead); AcDbBlockTableRecord *pBTRecord1; pBTable1->getAt(ACDB_MODEL_SPACE,pBTRecord1,AcDb::kForWrite); pBTable1->close(); AcDbObjectId plId1; if(pBTRecord1->appendAcDbEntity(plId1,Newline1)!=Acad::eOk) { Newline1->close(); pBTRecord1->close();
} Newline1->close(); pBTRecord1->close(); |
|