<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic acedTextBox in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/acedtextbox/m-p/1356978#M26243</link>
    <description>My application reads database by 2 types by user options, which are readCurrentDwg() and readOffLineDwg as follows.&lt;BR /&gt;
&lt;BR /&gt;
//-------------------------------&lt;BR /&gt;
void readCurrentDwg() {&lt;BR /&gt;
...&lt;BR /&gt;
err=acedSSGet(NULL, NULL, NULL, NULL, sset);&lt;BR /&gt;
for (i=0; i &amp;lt; length; i++) {&lt;BR /&gt;
acedSSName(sset, i, ename);&lt;BR /&gt;
acdbGetObjectId(ObjId, ename);&lt;BR /&gt;
AcDbEntity * pEnt;&lt;BR /&gt;
acdbOpenObject(pEnt, ObjId, AcDb::kForWrite);&lt;BR /&gt;
..&lt;BR /&gt;
}&lt;BR /&gt;
//-----------------------------&lt;BR /&gt;
&lt;BR /&gt;
void readOffLineDwg(char* dwgName) {&lt;BR /&gt;
AcDbDatabase *pDb = new AcDbDatabase(Adesk::kFalse);&lt;BR /&gt;
pDb-&amp;gt;readDwgFile(dwgName);&lt;BR /&gt;
AcDbBlockTable *pBlkTbl;&lt;BR /&gt;
pDb-&amp;gt;getSymbolTable(pBlkTbl, acedTextBoxAcDb::kForRead);&lt;BR /&gt;
AcDbBlockTableRecord *pBlkTblRcd;&lt;BR /&gt;
pBlkTbl-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForWrite);&lt;BR /&gt;
pBlkTbl-&amp;gt;close();&lt;BR /&gt;
AcDbBlockTableRecordIterator *pBlkTblRcdItr;&lt;BR /&gt;
pBlkTblRcd-&amp;gt;newIterator(pBlkTblRcdItr);&lt;BR /&gt;
for (pBlkTblRcdItr-&amp;gt;start(); !pBlkTblRcdItr-&amp;gt;done(); pBlkTblRcdItr-&amp;gt;step()){&lt;BR /&gt;
pBlkTblRcdItr-&amp;gt;getEntity(pEnt,AcDb::kForWrite);&lt;BR /&gt;
ObjId=pEnt-&amp;gt;objectId();&lt;BR /&gt;
.....&lt;BR /&gt;
}&lt;BR /&gt;
..&lt;BR /&gt;
}&lt;BR /&gt;
//----------------------------------&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
int tbox(){&lt;BR /&gt;
 ....&lt;BR /&gt;
 if (acedTextBox(textent, lowleft, upright) != RTNORM) { &lt;BR /&gt;
        return; &lt;BR /&gt;
    } &lt;BR /&gt;
 ...&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
And tbox() calls acedTextBox() as the above.&lt;BR /&gt;
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?&lt;BR /&gt;
The problem text font is Romans.&lt;BR /&gt;
Can I know what's the problem?</description>
    <pubDate>Fri, 17 Jun 2005 06:18:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-06-17T06:18:24Z</dc:date>
    <item>
      <title>acedTextBox</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acedtextbox/m-p/1356978#M26243</link>
      <description>My application reads database by 2 types by user options, which are readCurrentDwg() and readOffLineDwg as follows.&lt;BR /&gt;
&lt;BR /&gt;
//-------------------------------&lt;BR /&gt;
void readCurrentDwg() {&lt;BR /&gt;
...&lt;BR /&gt;
err=acedSSGet(NULL, NULL, NULL, NULL, sset);&lt;BR /&gt;
for (i=0; i &amp;lt; length; i++) {&lt;BR /&gt;
acedSSName(sset, i, ename);&lt;BR /&gt;
acdbGetObjectId(ObjId, ename);&lt;BR /&gt;
AcDbEntity * pEnt;&lt;BR /&gt;
acdbOpenObject(pEnt, ObjId, AcDb::kForWrite);&lt;BR /&gt;
..&lt;BR /&gt;
}&lt;BR /&gt;
//-----------------------------&lt;BR /&gt;
&lt;BR /&gt;
void readOffLineDwg(char* dwgName) {&lt;BR /&gt;
AcDbDatabase *pDb = new AcDbDatabase(Adesk::kFalse);&lt;BR /&gt;
pDb-&amp;gt;readDwgFile(dwgName);&lt;BR /&gt;
AcDbBlockTable *pBlkTbl;&lt;BR /&gt;
pDb-&amp;gt;getSymbolTable(pBlkTbl, acedTextBoxAcDb::kForRead);&lt;BR /&gt;
AcDbBlockTableRecord *pBlkTblRcd;&lt;BR /&gt;
pBlkTbl-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForWrite);&lt;BR /&gt;
pBlkTbl-&amp;gt;close();&lt;BR /&gt;
AcDbBlockTableRecordIterator *pBlkTblRcdItr;&lt;BR /&gt;
pBlkTblRcd-&amp;gt;newIterator(pBlkTblRcdItr);&lt;BR /&gt;
for (pBlkTblRcdItr-&amp;gt;start(); !pBlkTblRcdItr-&amp;gt;done(); pBlkTblRcdItr-&amp;gt;step()){&lt;BR /&gt;
pBlkTblRcdItr-&amp;gt;getEntity(pEnt,AcDb::kForWrite);&lt;BR /&gt;
ObjId=pEnt-&amp;gt;objectId();&lt;BR /&gt;
.....&lt;BR /&gt;
}&lt;BR /&gt;
..&lt;BR /&gt;
}&lt;BR /&gt;
//----------------------------------&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
int tbox(){&lt;BR /&gt;
 ....&lt;BR /&gt;
 if (acedTextBox(textent, lowleft, upright) != RTNORM) { &lt;BR /&gt;
        return; &lt;BR /&gt;
    } &lt;BR /&gt;
 ...&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
And tbox() calls acedTextBox() as the above.&lt;BR /&gt;
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?&lt;BR /&gt;
The problem text font is Romans.&lt;BR /&gt;
Can I know what's the problem?</description>
      <pubDate>Fri, 17 Jun 2005 06:18:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acedtextbox/m-p/1356978#M26243</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-17T06:18:24Z</dc:date>
    </item>
  </channel>
</rss>

