|
AcDbDatabase *pDb;
AcDbBlockTable *pTable;
AcDbBlockTableRecord *pRecord;
AcDbObjectId id;
pDb=acdbHostApplicationServices()->workingDatabase();
pDb->getBlockTable(pTable,AcDb::kForWrite);
pRecord=new AcDbBlockTableRecord();
if(pRecord->setName("*U*")!=Acad::eOk)
acutPrintf("\nerror!!!");
AcDbLine *pLine1=new AcDbLine(AcGePoint3d(0,0,0),AcGePoint3d(10,0,0));
AcDbLine *pLine2=new AcDbLine(AcGePoint3d(0,0,0),AcGePoint3d(0,10,0));
pRecord->appendAcDbEntity(pLine1);
pRecord->appendAcDbEntity(pLine2);
pLine1->close();
pLine2->close();
pTable->add(id,pRecord);
pRecord->close();
AcDbBlockReference *pIns=new AcDbBlockReference(AcGePoint3d(10,10,0),id);
pTable->getAt(ACDB_MODEL_SPACE,pRecord,AcDb::kForWrite);
pRecord->appendAcDbEntity(pIns);
pIns->close();
pRecord->close();
pTable->close(); |
|