找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 562|回复: 0

[ARX函数]:关于填充的问题???

[复制链接]
发表于 2003-9-15 01:05:04 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我为国外开发的一个设计软件,其中需要填充,这个函数如下:
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命令查看,结果和设置一样;
请个位帮我看看!!!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-12-26 14:14 , Processed in 0.387351 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表