Message 1 of 1
acedTextBox

Not applicable
06-16-2005
11:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My application reads database by 2 types by user options, which are readCurrentDwg() and readOffLineDwg as follows.
//-------------------------------
void readCurrentDwg() {
...
err=acedSSGet(NULL, NULL, NULL, NULL, sset);
for (i=0; i < length; i++) {
acedSSName(sset, i, ename);
acdbGetObjectId(ObjId, ename);
AcDbEntity * pEnt;
acdbOpenObject(pEnt, ObjId, AcDb::kForWrite);
..
}
//-----------------------------
void readOffLineDwg(char* dwgName) {
AcDbDatabase *pDb = new AcDbDatabase(Adesk::kFalse);
pDb->readDwgFile(dwgName);
AcDbBlockTable *pBlkTbl;
pDb->getSymbolTable(pBlkTbl, acedTextBoxAcDb::kForRead);
AcDbBlockTableRecord *pBlkTblRcd;
pBlkTbl->getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForWrite);
pBlkTbl->close();
AcDbBlockTableRecordIterator *pBlkTblRcdItr;
pBlkTblRcd->newIterator(pBlkTblRcdItr);
for (pBlkTblRcdItr->start(); !pBlkTblRcdItr->done(); pBlkTblRcdItr->step()){
pBlkTblRcdItr->getEntity(pEnt,AcDb::kForWrite);
ObjId=pEnt->objectId();
.....
}
..
}
//----------------------------------
If the entity is text type, the above functions call a ReadText() function to read text. In ReadText() function, it calls tbox(), which is shown ObjectArx Manual.
int tbox(){
....
if (acedTextBox(textent, lowleft, upright) != RTNORM) {
return;
}
...
}
And tbox() calls acedTextBox() as the above.
The problem is that it gets the correct result in readCurrentDwg(). However, it fails to get the correct answer in readOffLineDwg(). The reason is the the return value of acedTextBox(textent, lowleft, upright) is -5100 not 5100. It works correctly for some drawings but not works for some drawings. Is it related to font or text style?
The problem text font is Romans.
Can I know what's the problem?
//-------------------------------
void readCurrentDwg() {
...
err=acedSSGet(NULL, NULL, NULL, NULL, sset);
for (i=0; i < length; i++) {
acedSSName(sset, i, ename);
acdbGetObjectId(ObjId, ename);
AcDbEntity * pEnt;
acdbOpenObject(pEnt, ObjId, AcDb::kForWrite);
..
}
//-----------------------------
void readOffLineDwg(char* dwgName) {
AcDbDatabase *pDb = new AcDbDatabase(Adesk::kFalse);
pDb->readDwgFile(dwgName);
AcDbBlockTable *pBlkTbl;
pDb->getSymbolTable(pBlkTbl, acedTextBoxAcDb::kForRead);
AcDbBlockTableRecord *pBlkTblRcd;
pBlkTbl->getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForWrite);
pBlkTbl->close();
AcDbBlockTableRecordIterator *pBlkTblRcdItr;
pBlkTblRcd->newIterator(pBlkTblRcdItr);
for (pBlkTblRcdItr->start(); !pBlkTblRcdItr->done(); pBlkTblRcdItr->step()){
pBlkTblRcdItr->getEntity(pEnt,AcDb::kForWrite);
ObjId=pEnt->objectId();
.....
}
..
}
//----------------------------------
If the entity is text type, the above functions call a ReadText() function to read text. In ReadText() function, it calls tbox(), which is shown ObjectArx Manual.
int tbox(){
....
if (acedTextBox(textent, lowleft, upright) != RTNORM) {
return;
}
...
}
And tbox() calls acedTextBox() as the above.
The problem is that it gets the correct result in readCurrentDwg(). However, it fails to get the correct answer in readOffLineDwg(). The reason is the the return value of acedTextBox(textent, lowleft, upright) is -5100 not 5100. It works correctly for some drawings but not works for some drawings. Is it related to font or text style?
The problem text font is Romans.
Can I know what's the problem?