[求助]请帮帮忙
<p>void onlable()<br/>{<br/> float rads;<br/> int rest,integer,length;<br/> for(int k=0;k<3;k++)<br/> {<br/> // Return the angle in the XY plane of the current UCS, in radians.<br/> rads=acutAngle(pt, pt);<br/> // Return distance in 3D space.<br/> length=acutDistance(pt, pt);<br/> rest=length%100;//求余数<br/> integer=length/100;//求每一段整100的个数<br/> } <br/> ads_point startpt,endpt;<br/> for(int r=0;r<3;r++)<br/> for(int j=0;j<3;j++)<br/> { <br/> acutPolar(pt, rads, 100*j, startpt);<br/> acutPolar(startpt,rads+3.1415926/2,50,endpt); <br/> AcDbLine*pLine=new AcDbLine(AcGePoint3d(startpt,startpt,0),<br/> AcGePoint3d(endpt,endpt,0));<br/> } <br/> pLine->setColorIndex(1);//红色 <br/> AcDbBlockTable *pBlockTable;<br/> acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);<br/> AcDbBlockTableRecord *pBlockTableRecord;<br/> pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);<br/> pBlockTable->close();<br/> AcDbObjectId lineId;<br/> pBlockTableRecord->appendAcDbEntity(lineId,pLine);<br/> pBlockTableRecord->close();<br/> pLine->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 '->setColorIndex' must point to class/struct/union<br/>E:\my doc\ARX\forth\FirstCommands.cpp(274) : error C2227: left of '->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> <p>好好学习下C++, 括号放错位置了:</p><p> for(int j=0;j<3;j++)<br/> { <br/> acutPolar(pt, rads, 100*j, startpt);<br/> acutPolar(startpt,rads+3.1415926/2,50,endpt); <br/> AcDbLine*pLine=new AcDbLine(AcGePoint3d(startpt,startpt,0),<br/> AcGePoint3d(endpt,endpt,0));<br/> <font color="#ff0000">// }错误地方</font><br/> pLine->setColorIndex(1);//红色 <br/> AcDbBlockTable *pBlockTable;<br/> acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);<br/> AcDbBlockTableRecord *pBlockTableRecord;<br/> pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);<br/> pBlockTable->close();<br/> AcDbObjectId lineId;<br/> pBlockTableRecord->appendAcDbEntity(lineId,pLine);<br/> pBlockTableRecord->close();<br/> pLine->close(); </p><p> <font color="#ff0000"> }//正确地方</font></p> <p>非常感谢老牛~~</p><p>一直困扰了我很久啊~ 我还以为里面的函数用错了</p>
页:
[1]