这是 HELP 中的说明,也看的不是很懂,望有高手翻译一下吧
virtual Acad::ErrorStatus
adjustAlignment(const AcDbDatabase* pDb = NULL);
pDb |
Input pointer to database to be used if the text entity is not in a database (this argument is ignored if the text entity is in a database) |
Normally when a text entity is closed, the text's position and alignment points are adjusted according to the text's justification settings and the text style. But, if the text entity is embedded in another entity, it will never be closed in which case it won't automatically be adjusted. Or, if the text is added to a transaction before it's first close(), and the graphics are flushed to the screen before the outermost transaction ends, the text will be displayed before the automatic adjustment takes place.
This method allows a way to cause the text to be adjusted on non-database resident text entities or text entities within transactions.
If the text entity is not database resident, then pDb must not be NULL, otherwise Acad::eNoDatabase will be returned. If the text entity is database resident, then the entity's database will be used regardless of the value of pDb.
When this method is called, the database used must also be the current working database (as returned by acdbHostApplicationServices()->workingDatabase()), the text entity must have non-NULL text string data and a valid text style objectId that resides in the database being used, otherwise Acad::eInvalidContext will be returned.
Returns Acad::eOk if successful. |