_t ("\\PXQL;") Left//_t ("\\PXQR;") Right//_t ("\\PXQC;") Center//_t ("\\PXQD;") Scatter aligned//mtextinfoid text idacdbobjectpointer<acdbmtext> pent_1 (mtextinfoid, Acdb::kforwrite), if (pEnt_1. Openstatus () = = Acad::eok) {Achar * Pachar = pent_1->contents ();//This function returns text content and alignment style//eg: text content is small Cyan peak format set to left// In the CAD property bar can see the text content is: \pxql; xiaoqing Peak//cad is the use of _t ("\\PXQL;") _t ("\\PXQR;") _t ("\\PXQC;") The _t ("\\PXQD;") parameter sets the alignment of multiline text CString strtmp (pachar); int nIndex = Strtmp.replace (_t ("\\PXQL;"), _t ("\\PXQC;"); Set by the original left to center int nIndex = pent_1->setcontents (strtmp);//Set the format and content together to Pent_1->setattachment (Acdbmtext:: Kmiddlecenter);//On the hot this function just sets the insertion point position of the text, the alignment is not set pent_1->text ();//Get just text content//What you want to effect your own combination,}
Objectarx Study Notes (32)----How to set acdbmtext alignment