- UID
- 11237
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-10-12
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
我为国外开发的一个设计软件,其中需要填充,这个函数如下:
void Hatch(LPCTSTR pDstyle,double pHA,double pHS,int colorId,AcGePoint3dArray points)
{
CString strdraw;
strdraw.Format("Create HATCH %s ......!\n",pDstyle);
ads_printf(strdraw);
AcDbBlockTable *pBlockTable;
pDb->getBlockTable(pBlockTable,AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);
pBlockTable->close();
AcGePoint3dArray pointnew;
AcGePoint3d pt;
AcGePoint3d ptnew;
long length = points.length();
ads_printf("line 1\n");
for(int i = 0;i<length;i++)
{
pt = points.at(i);
ptnew[0] = ptbase[0] + pt[0]*ismirror;
ptnew[1] = ptbase[1] + pt[1];
ptnew[2] = ptbase[2] + pt[2];
pointnew.append(ptnew);
ads_printf("line 11\n");
}
ads_printf("line 2\n");
AcDbObjectIdArray objIds;
AcDbHatch* pHatch = new AcDbHatch();
ads_printf("line 3\n");
AcGeVector3d normal(0.0, 0.0, 1.0);
ads_printf("line 4\n");
pHatch->setNormal(normal);
ads_printf("line 5\n");
pHatch->setElevation(0.0);
ads_printf("line 6\n");
pHatch->setAssociative(Adesk::kFalse);
ads_printf("line 7\n");
pHatch->setPattern(AcDbHatch::kPreDefined, pDstyle);
ads_printf("line 8\n");
pHatch->setPatternAngle(pHA);
ads_printf("line 9\n");
pHatch->setPatternScale(pHS);
ads_printf("line 10\n");
pHatch->setColorIndex(colorId);
ads_printf("line 11\n");
pHatch->setHatchStyle(AcDbHatch::kNormal);
ads_printf("line 12\n");
AcDb2dPolyline *newspline=new AcDb2dPolyline(AcDb::k2dSimplePoly,pointnew,0,TRUE,0,0,NULL);
ads_printf("line 13\n");
AcDbObjectId newsplineID;
pBlockTableRecord->appendAcDbEntity(newsplineID,newspline);
ads_printf("line 14\n");
objIds.append(newsplineID);
newspline->setColorIndex(2);
ads_printf("line 15\n");
newspline->close();
ads_printf("line 16\n");
pHatch->appendLoop(AcDbHatch::kExternal, objIds);
ads_printf("line 17\n");
pHatch->evaluateHatch();
ads_printf("line 18\n");
pBlockTableRecord->appendAcDbEntity(pHatch);
ads_printf("line 19\n");
pBlockTableRecord->close();
ads_printf("line 20\n");
pHatch->close();
EraseEntity(newsplineID);
ads_printf("line 21\n");
strdraw.Format("Create HATCH %s OK!\n",pDstyle);
ads_printf(strdraw);
}
在我的计算机正确运行,如输入样式为:dots,比例:15,角度:0,正确运行;
而在新加坡运行时,同样的输入,明显不正确,用list命令查看,结果和设置一样;
请个位帮我看看!!! |
|