几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】[求助]请帮帮忙 (http://www.dimcax.com/hust/showthread.php?t=6927)

yang686526 2009-04-16 05:20 PM

【转帖】[求助]请帮帮忙
 
[求助]请帮帮忙
[求助]请帮帮忙
void onlable()
{
float rads[3];
int rest[3],integer[3],length[3];
for(int k=0;k<3;k++)
{
// return the angle in the xy plane of the current ucs, in radians.
rads[k]=acutangle(pt[k], pt[k+1]);
// return distance in 3d space.
length[k]=acutdistance(pt[k], pt[k+1]);
rest[k]=length[k]%100;//求余数
integer[k]=length[k]/100;//求每一段整100的个数
}
ads_point startpt[5000],endpt[5000];
for(int r=0;r<3;r++)
for(int j=0;j<3;j++)
{
acutpolar(pt[r], rads[r], 100*j, startpt[j]);
acutpolar(startpt[j],rads[r]+3.1415926/2,50,endpt[j]);
acdbline*pline=new acdbline(acgepoint3d(startpt[j][0],startpt[j][1],0),
acgepoint3d(endpt[j][0],endpt[j][1],0));
}
pline->setcolorindex(1);//红色
acdbblocktable *pblocktable;
acdbhostapplicationservices()->workingdatabase()->getsymboltable(pblocktable,acdb::kforread);
acdbblocktablerecord *pblocktablerecord;
pblocktable->getat(acdb_model_space,pblocktablerecord,acdb::kforwrite);
pblocktable->close();
acdbobjectid lineid;
pblocktablerecord->appendacdbentity(lineid,pline);
pblocktablerecord->close();
pline->close();
}
//ads_point pt[4] 为全局变量
e:\my doc\arx\forth\firstcommands.cpp(265) : error c2065: 'pline' : undeclared identifier
e:\my doc\arx\forth\firstcommands.cpp(265) : error c2227: left of '->setcolorindex' must point to class/struct/union
e:\my doc\arx\forth\firstcommands.cpp(274) : error c2227: left of '->close' must point to class/struct/union
error executing cl.exe.
first.arx - 3 error(s), 0 warning(s)
请各位高手帮帮忙,是点没转化好,还是acutpolar函数返回的值没有呢?
获赠明经币帖,共获得 0 个明经币
好好学习下c++, 括号放错位置了:
for(int j=0;j<3;j++)
{
acutpolar(pt[r], rads[r], 100*j, startpt[j]);
acutpolar(startpt[j],rads[r]+3.1415926/2,50,endpt[j]);
acdbline*pline=new acdbline(acgepoint3d(startpt[j][0],startpt[j][1],0),
acgepoint3d(endpt[j][0],endpt[j][1],0));
// }错误地方
pline->setcolorindex(1);//红色
acdbblocktable *pblocktable;
acdbhostapplicationservices()->workingdatabase()->getsymboltable(pblocktable,acdb::kforread);
acdbblocktablerecord *pblocktablerecord;
pblocktable->getat(acdb_model_space,pblocktablerecord,acdb::kforwrite);
pblocktable->close();
acdbobjectid lineid;
pblocktablerecord->appendacdbentity(lineid,pline);
pblocktablerecord->close();
pline->close();
}//正确地方
赠送楼主 0个明经币
非常感谢老牛~~
一直困扰了我很久啊~ 我还以为里面的函数用错了
赠送楼主 0个明经币
赠送楼主 0个明经币


所有的时间均为北京时间。 现在的时间是 03:55 PM.