Kerry 发表于 2005-11-16 00:47:32

我相信代码是基于c的广告,而不是c++ arx

Kerry 发表于 2005-11-16 11:16:47

我认为这将在arx中划清界限,我没有编译它以供检查...
                AcDbDatabase *pCurrentDB; // pointer to hole current drawing database
                AcGePoint3d stpt(0.0,0.0,0.0); //3d starting point
                AcGePoint3d endpt(5.0,5.0,0.0);; //3d ending point
                AcDbLine *acLine = new AcDbLine(stpt, endpt); // create a new newline
                pCurrentDB = acdbHostApplicationServices()->workingDatabase(); // set pointer to workling database
                AcDbBlockTable *pBlockTable;
                pCurrentDB->getBlockTable(pBlockTable, AcDb::kForRead); //get the block table
                AcDbBlockTableRecord *pBlockTableRecord;
                pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); // get a blocktablerecord
                pBlockTable->close();
                AcDbObjectId lineId;
                pBlockTableRecord->appendAcDbEntity(lineId, acLine); // Actually adds the line to the drawing
                pBlockTableRecord->close();
                acLine->close();

页: 1 [2]
查看完整版本: 画一条简单的线...