Explode text using API

Explode text using API

Anonymous
Not applicable
994 Views
1 Reply
Message 1 of 2

Explode text using API

Anonymous
Not applicable

Hi,

 

I want to use Explode text for MText. Can anyone tell me how should i achieve this?

 

Thanks & Regards,

Satyajeet

0 Likes
995 Views
1 Reply
Reply (1)
Message 2 of 2

StephenPreston
Alumni
Alumni

Are you asking how to use the AcDbMtext::explodeFragments() function? Here's a code snippet from a technical article on the ADN website that demonstrates its usage:

 

<code>
{
.....
......
AcDbMText *pMText = (AcDbMText*) pEnt;
// Get every MTEXT fragment
pMText->explodeFragments(MTextEnum, NULL);
pMText->close();
.....
......

}
 
// This function is the callback function for
// explodeFragments(). Here you will get the
// MTEXT fragmentsint
MTextEnum(AcDbMTextFragment *frag, void *param)
{
 
 AcDbText *pText = new AcDbText;
 AcDbObjectId styleId = CreateStyle(frag);
 if (styleId == AcDbObjectId::kNull) 
 return 1;
 pText->setTextString(frag->text);
 acutPrintf(L"\n %d) \t  %s",rowCount,pText->textString());
 rowCount++;
 return 1;
}
</code>

 

Cheers,


Stephen Preston

Autodesk Developer Network

Cheers,

Stephen Preston
Autodesk Developer Network
0 Likes