|
高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】[求助]请帮帮忙
[求助]请帮帮忙
[求助]请帮帮忙
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个明经币
|