|
发表于 2005-5-18 22:09:00
|
显示全部楼层
//
// ObjectARX defined commands, created by [2005-5-17], ,
#include "StdAfx.h"
#include "StdArx.h"
#include "dbsymtb.h"
#include "dbents.h"
//-----------------------------------------------------------------------------
// This is command 'NEWDOC, by [2005-5-17], ,
void ACADnewdoc()
{
#ifdef OARXWIZDEBUG
acutPrintf ("\nOARXWIZDEBUG - ACADnewdoc() called.");
#endif // OARXWIZDEBUG
// TODO: Implement the command
static char pData[] ="acad.dwt";
acDocManager->executeInApplicationContext(CreateDoc, (void *)pData);
AcDbDatabase *pdb =acdbHostApplicationServices()->workingDatabase();
AcDbBlockTable *pBtbl;
pdb->getSymbolTable(pBtbl, AcDb::kForRead);
AcDbBlockTableRecord *pBtblRcd;
pBtbl->getAt(ACDB_MODEL_SPACE, pBtblRcd,
AcDb::kForWrite);
pBtbl->close();
AcDbCircle *pCir1 = new AcDbCircle(AcGePoint3d(1,1,1),
AcGeVector3d(0,0,1),
1.0),
*pCir2 = new AcDbCircle(AcGePoint3d(4,4,4),
AcGeVector3d(0,0,1),
2.0);
pBtblRcd->appendAcDbEntity(pCir1);
pCir1->close();
pBtblRcd->appendAcDbEntity(pCir2);
pCir2->close();
pBtblRcd->close();
}
void CreateDoc( void *pData)
{
AcApDocument* pDoc = acDocManager->curDocument();
if(acDocManager->isApplicationContext())
{
acDocManager->appContextNewDocument((const char *)pData);
}
else
acutPrintf("\nERROR To Create Doc!\n");
} |
|