运行了以下的程序,没有发现问题。 看来,今后还是要用ObjectARX C++来开发AutoCAD的应用程序。 static void test_pickfirst(void) { ads_name ssname, ent; long nssmem, i; struct resbuf *ebuf, *eb; // Get the current PICKFIRST set, if there is one; // otherwise, ask the user for a general entity selection. if (acedSSGet(NULL, NULL, NULL, NULL, ssname)!= RTNORM) { return; } if (acedSSLength(ssname, &nssmem) != RTNORM) { return; } acutPrintf(_T("\n %ld\n"),nssmem); for (i=0; i<nssmem; i++){ if (acedSSName(ssname, i, ent) != RTNORM){ acdbFail(_T("\nFail\n")); return; } ebuf = acdbEntGet(ent); for (eb = ebuf; eb != NULL; eb = eb->rbnext) { printdxf(eb); //1. To print the dxf code of the entity(defined in other file.cpp) } acutRelRb(ebuf); } acedSSFree(ssname); } |