明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1801|回复: 0

[ARX]求助,版主!程序调不通

[复制链接]
发表于 2005-1-7 17:13:00 | 显示全部楼层 |阅读模式
我选择了一条pline线,并对其中的点遍历,并把点坐标,导出到一个点数组points()中 但我的程序运行完了后,这条线就不能在CAD中编辑,一修改编辑,CAD就自动关闭了! 请版主看一看,谢谢!!! AcDb2dPolyline* pline2d;
AcDbObjectId objId=AcDbObjectId::kNull;
AcGePoint3d lPt( 0.0, 0.0, 0.0);
int j;j=0;
long sslen; int result; ads_name m_ss;
struct resbuf* filter;
result = acedSSGet(_T(":S"), NULL, NULL, NULL, m_ss);
acedSSLength(m_ss, &sslen); int ret;
ads_name ent;
for (long i=0L; i<sslen; i++) {
ret = acedSSName(m_ss, i, ent);
ASSERT(ret == RTNORM);
Acad::ErrorStatus es = acdbGetObjectId(objId, ent);
}
AcDbEntity * pEnt;
acdbOpenObject(pEnt,objId,AcDb::kForRead); AcDb3dPolyline* pline3d;
AcDbPolygonMesh* pmesh;
AcDbPolyFaceMesh* pface;
AcDbPolyline* pline;
AcDbObjectIterator* vertexIter;
Acad::ErrorStatus es; if ((pline2d = AcDb2dPolyline::cast(pEnt)) != NULL)
vertexIter = pline2d->vertexIterator();
else if ((pline3d = AcDb3dPolyline::cast(pEnt)) != NULL)
vertexIter = pline3d->vertexIterator();
else if ((pmesh = AcDbPolygonMesh::cast(pEnt)) != NULL)
vertexIter = pmesh->vertexIterator();
else if ((pface = AcDbPolyFaceMesh::cast(pEnt)) != NULL)
vertexIter = pface->vertexIterator();
else if ((pline = AcDbPolyline::cast(pEnt)) != NULL)
{
for (unsigned int j=0; j<pline->numVerts(); j++) {
es = pline->getPointAt(j, lPt);
if (es == Acad::eOk) {
points[j].x=lPt.x;
points[j].y=lPt.y;
}
}
return j;
}
else
vertexIter = NULL;
pline->close();
pEnt->close();
return 0;
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 08:33 , Processed in 0.147777 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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