更改 AcDbMText 对象的背景掩码属性
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..."));
}
}
页:
[1]