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函数返回的值没有呢? |