|
[code]void test_setBackgroundFill_MText()
{
ads_name ename;
ads_point p;
// select the entity
int res = acedEntSel(_T("Please pick an MText entity: "), ename, p );
// if ok
if (res == RTNORM)
{
AcDbObjectId oId;
acdbGetObjectId( oId, ename );
AcDbObjectPointer<AcDbMText> pMText(oId, AcDb::kForWrite);
if(pMText.openStatus() == Acad::eOk)
{
AcCmColor color;
if(pMText->backgroundFillOn())
{
pMText->setUseBackgroundColor(false);
pMText->setBackgroundFill(false);
}
else
{
pMText->setBackgroundFill(true);
color.setColorIndex(1);
pMText->setBackgroundFillColor(color);
pMText->setUseBackgroundColor(false);
}
}
else
acutPrintf(_T("\nError - you need to select an MText entity..."));
}
}[/code] |
|