|
[code]void createNewUcs(AcGePoint3d ptOri,AcGeVector3d vecXAxis,AcGeVector3d vecYAxis,CString ucsName)
{
AcDbUCSTable *pUcsTbl;
acdbHostApplicationServices()->workingDatabase()->
getUCSTable(pUcsTbl,AcDb::kForWrite);
//
AcDbUCSTableRecord *pUcsTblRcd = new AcDbUCSTableRecord();
//
Acad::ErrorStatus es = pUcsTblRcd->setName(ucsName);
if (es != Acad::eOk)
{
delete pUcsTblRcd;
pUcsTbl->close();
return;
}
pUcsTblRcd->setOrigin(ptOri);
pUcsTblRcd->setXAxis(vecXAxis);
pUcsTblRcd->setYAxis(vecYAxis);
//
es = pUcsTbl->add(pUcsTblRcd);
if (es != Acad::eOk)
{
delete pUcsTblRcd;
pUcsTbl->close();
return;
}
//
pUcsTblRcd->close();
pUcsTbl->close();
}[/code] |
|