mealisthzy 发表于 2006-12-29 16:20:00

[求助]请帮帮忙

<p>void onlable()<br/>{<br/>&nbsp;&nbsp; float rads;<br/>&nbsp;&nbsp; int rest,integer,length;<br/>&nbsp;&nbsp; for(int k=0;k&lt;3;k++)<br/>&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp; // Return the angle in the XY plane of the current UCS, in radians.<br/>&nbsp;&nbsp;&nbsp; rads=acutAngle(pt, pt);<br/>&nbsp;&nbsp;&nbsp; // Return distance in 3D space.<br/>&nbsp;&nbsp;&nbsp; length=acutDistance(pt, pt);<br/>&nbsp;&nbsp;&nbsp; rest=length%100;//求余数<br/>&nbsp;&nbsp;&nbsp; integer=length/100;//求每一段整100的个数<br/>&nbsp;&nbsp; } <br/>&nbsp;&nbsp;&nbsp; ads_point&nbsp; startpt,endpt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int r=0;r&lt;3;r++)<br/>&nbsp;&nbsp;&nbsp; for(int j=0;j&lt;3;j++)<br/>&nbsp;&nbsp;&nbsp; {&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acutPolar(pt, rads, 100*j, startpt);<br/>&nbsp;&nbsp; acutPolar(startpt,rads+3.1415926/2,50,endpt);&nbsp;<br/>&nbsp;&nbsp; AcDbLine*pLine=new AcDbLine(AcGePoint3d(startpt,startpt,0),<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcGePoint3d(endpt,endpt,0));<br/>&nbsp;&nbsp;&nbsp; }&nbsp; <br/>&nbsp; &nbsp;&nbsp;pLine-&gt;setColorIndex(1);//红色 <br/>&nbsp;&nbsp;&nbsp;&nbsp; AcDbBlockTable *pBlockTable;<br/>&nbsp;&nbsp;&nbsp;&nbsp; acdbHostApplicationServices()-&gt;workingDatabase()-&gt;getSymbolTable(pBlockTable,AcDb::kForRead);<br/>&nbsp;&nbsp;&nbsp;&nbsp; AcDbBlockTableRecord *pBlockTableRecord;<br/>&nbsp;&nbsp;&nbsp;&nbsp; pBlockTable-&gt;getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);<br/>&nbsp;&nbsp;&nbsp;&nbsp; pBlockTable-&gt;close();<br/>&nbsp;&nbsp;&nbsp;&nbsp; AcDbObjectId lineId;<br/>&nbsp;&nbsp;&nbsp;&nbsp; pBlockTableRecord-&gt;appendAcDbEntity(lineId,pLine);<br/>&nbsp;&nbsp;&nbsp;&nbsp; pBlockTableRecord-&gt;close();<br/>&nbsp;&nbsp;&nbsp;&nbsp; pLine-&gt;close(); <br/>}</p><p>//ads_point pt 为全局变量</p><p>E:\my doc\ARX\forth\FirstCommands.cpp(265) : error C2065: 'pLine' : undeclared identifier<br/>E:\my doc\ARX\forth\FirstCommands.cpp(265) : error C2227: left of '-&gt;setColorIndex' must point to class/struct/union<br/>E:\my doc\ARX\forth\FirstCommands.cpp(274) : error C2227: left of '-&gt;close' must point to class/struct/union<br/>Error executing cl.exe.</p><p>First.arx - 3 error(s), 0 warning(s)</p><p>请各位高手帮帮忙,是点没转化好,还是acutPolar函数返回的值没有呢?</p>

老牛 发表于 2007-1-4 11:35:00

<p>好好学习下C++, 括号放错位置了:</p><p>&nbsp;&nbsp;&nbsp; for(int j=0;j&lt;3;j++)<br/>&nbsp;&nbsp;&nbsp; {&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acutPolar(pt, rads, 100*j, startpt);<br/>&nbsp;&nbsp; acutPolar(startpt,rads+3.1415926/2,50,endpt);&nbsp;<br/>&nbsp;&nbsp; AcDbLine*pLine=new AcDbLine(AcGePoint3d(startpt,startpt,0),<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcGePoint3d(endpt,endpt,0));<br/>&nbsp;&nbsp;<font color="#ff0000">//&nbsp; }错误地方</font><br/>&nbsp;&nbsp;&nbsp;&nbsp;pLine-&gt;setColorIndex(1);//红色 <br/>&nbsp;&nbsp;&nbsp;&nbsp; AcDbBlockTable *pBlockTable;<br/>&nbsp;&nbsp;&nbsp;&nbsp; acdbHostApplicationServices()-&gt;workingDatabase()-&gt;getSymbolTable(pBlockTable,AcDb::kForRead);<br/>&nbsp;&nbsp;&nbsp;&nbsp; AcDbBlockTableRecord *pBlockTableRecord;<br/>&nbsp;&nbsp;&nbsp;&nbsp; pBlockTable-&gt;getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);<br/>&nbsp;&nbsp;&nbsp;&nbsp; pBlockTable-&gt;close();<br/>&nbsp;&nbsp;&nbsp;&nbsp; AcDbObjectId lineId;<br/>&nbsp;&nbsp;&nbsp;&nbsp; pBlockTableRecord-&gt;appendAcDbEntity(lineId,pLine);<br/>&nbsp;&nbsp;&nbsp;&nbsp; pBlockTableRecord-&gt;close();<br/>&nbsp;&nbsp;&nbsp;&nbsp; pLine-&gt;close(); </p><p>&nbsp;&nbsp;<font color="#ff0000">&nbsp; }//正确地方</font></p>

mealisthzy 发表于 2007-1-4 13:47:00

<p>非常感谢老牛~~</p><p>一直困扰了我很久啊~ 我还以为里面的函数用错了</p>

warmwind 发表于 2007-1-7 20:19:00

页: [1]
查看完整版本: [求助]请帮帮忙