<?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 Re: Why the dimensions not show? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6807054#M9016</link>
    <description>OH, I should try it again without the setting of database.</description>
    <pubDate>Mon, 16 Jan 2017 03:19:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-16T03:19:16Z</dc:date>
    <item>
      <title>Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6777534#M9005</link>
      <description>&lt;P&gt;I use the function wblock to clone some entities from the current document(Doc A) to a new document(Doc B, created while the progress),&lt;/P&gt;&lt;PRE&gt;es = pTempDb-&amp;gt;wblock(pTargetDb, idsNeedClone, AcGePoint3d::kOrigin, AcDb::kDrcReplace);&lt;/PRE&gt;&lt;P&gt;and the new document is used in another doc(Doc C) by xref. &amp;nbsp;But in Doc C, the dimensions in Doc B not show, until I redraw all the entities in Doc B.&lt;/P&gt;&lt;P&gt;So after wblock, I redraw all the entities in Doc B using this code&lt;/P&gt;&lt;PRE&gt;pEnt-&amp;gt;recordGraphicsModified(true);&lt;/PRE&gt;&lt;P&gt;But, the dimensions in a block which is in the Doc B are also not show in Doc C.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what the problem? And what should I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Happy new year!&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 17:04:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6777534#M9005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-01T17:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6777537#M9006</link>
      <description>&lt;P&gt;I tried to redraw all the entities in that blockTableRecord, but they still not show.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 16:55:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6777537#M9006</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-01T16:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6781089#M9007</link>
      <description>Without your sample project and sample dwg-file I can not explain this issue.</description>
      <pubDate>Tue, 03 Jan 2017 23:46:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6781089#M9007</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-01-03T23:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6794483#M9008</link>
      <description>&lt;P&gt;Sorry for late response,&lt;/P&gt;&lt;P&gt;I use this code to wblock a dwg-file to a new dwg-file.&lt;/P&gt;&lt;PRE&gt;es = pTempDb-&amp;gt;wblock(pTargetDb, idsNeedClone, AcGePoint3d::kOrigin, AcDb::kDrcReplace);
es = pTargetDb-&amp;gt;closeInput(true);
es = acdbSaveAs2004(pTargetDb, strTargetFileFullPath);&lt;/PRE&gt;&lt;P&gt;In the source file, there is a block like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QQ截图20170110154935.jpg" style="width: 345px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/309533i5A8B57045634F455/image-size/large?v=v2&amp;amp;px=999" role="button" title="QQ截图20170110154935.jpg" alt="QQ截图20170110154935.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I wblock it out to a new dwg-file, the block looks like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QQ截图20170110155218.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/309534i82DD4DF8E4C1F956/image-size/large?v=v2&amp;amp;px=999" role="button" title="QQ截图20170110155218.jpg" alt="QQ截图20170110155218.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I open it using refedit, the dimensions appear again.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2017 07:55:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6794483#M9008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-10T07:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6804466#M9009</link>
      <description>&lt;P&gt;Without full code I have only one idea. Instead of &lt;EM&gt;wblock&lt;/EM&gt; you can use &lt;EM&gt;wblockCloneObjects&lt;/EM&gt; and after that iterate idMap in order to find new created AcDbDimension's, open it and call &lt;EM&gt;recomputeDimBlock&lt;/EM&gt; method for every dimension.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 17:36:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6804466#M9009</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-01-13T17:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6805489#M9010</link>
      <description>&lt;P&gt;the sample code is like this&lt;/P&gt;
&lt;PRE&gt;// - ZHPCDC.TEST command (do not rename)
	static void ZHPCDCTEST(void)
	{
		// Add your code for command ZHPCDC.TEST here
		Acad::ErrorStatus es;
		CString strTargetFileFullPath = TEXT("D:\\test.dwg");

		//create the new file
		AcDbDatabase *pNewDb = new AcDbDatabase(true, false);
		es = pNewDb-&amp;gt;saveAs(strTargetFileFullPath);
		delete pNewDb;

		// get the targetDb, sourceDb and tempDb
		AcDbDatabase *pTargetDb = new AcDbDatabase(false);
		pTargetDb-&amp;gt;readDwgFile(strTargetFileFullPath);
		AcDbDatabase *pSourceDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();
		AcDbDatabase *pTempDb = new AcDbDatabase(true, true);
		es = pSourceDb-&amp;gt;wblock(pTempDb);
		// get the entities that need clone
		AcDbObjectIdArray idsNeedClone;
		AcDbBlockTable *pBlkTbl = NULL;
		pTempDb-&amp;gt;getBlockTable(pBlkTbl, AcDb::kForRead);
		AcDbBlockTableRecord *pBlkTblRcd = NULL;
		pBlkTbl-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForWrite);
		pBlkTbl-&amp;gt;close();
		AcDbBlockTableRecordIterator *it = NULL;
		pBlkTblRcd-&amp;gt;newIterator(it);
		for (it-&amp;gt;start(); !it-&amp;gt;done(); it-&amp;gt;step())
		{
			AcDbObjectId id;
			if (Acad::eOk != it-&amp;gt;getEntityId(id)) continue;
			idsNeedClone.append(id);
		}
		delete it;
		pBlkTblRcd-&amp;gt;close();


		// clone from tempDb to targetDb
		pTempDb-&amp;gt;wblock(pTargetDb, idsNeedClone, AcGePoint3d::kOrigin, AcDb::kDrcReplace);

		//redraw the entities in targetDb and saveas
		CDwgDatabaseUtil::RedrawAllEntitys(pTargetDb);
		es = pTargetDb-&amp;gt;closeInput(true);
		es = acdbSaveAs2004(pTargetDb, strTargetFileFullPath);

		delete pTargetDb;
		delete pTempDb;
	}&lt;/PRE&gt;
&lt;P&gt;and the function&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;CDwgDatabaseUtil::RedrawAllEntitys(pTargetDb);&lt;/PRE&gt;
&lt;P&gt;is like this&lt;/P&gt;
&lt;PRE&gt;void CDwgDatabaseUtil::RedrawAllEntitys(AcDbDatabase *pDb)
{
	// 获得块表
	AcDbBlockTable *pBlkTbl = NULL;
	pDb-&amp;gt;getBlockTable(pBlkTbl, AcDb::kForRead);

	// 获得模型空间的块表记录
	AcDbBlockTableRecord *pBlkTblRcd = NULL;
	pBlkTbl-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForRead);
	pBlkTbl-&amp;gt;close();

	// 创建遍历器，依次访问模型空间的每一个实体
	AcDbBlockTableRecordIterator *it = NULL;
	pBlkTblRcd-&amp;gt;newIterator(it);
	for (it-&amp;gt;start(); !it-&amp;gt;done(); it-&amp;gt;step())
	{
		AcDbEntity *pEnt = NULL;
		if (Acad::eOk == it-&amp;gt;getEntity(pEnt, AcDb::kForWrite))
		{
			pEnt-&amp;gt;recordGraphicsModified(true);
			pEnt-&amp;gt;close();
		}
	}
	delete it;
	pBlkTblRcd-&amp;gt;close();
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and here is the video to express my problem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="9cc890f3-cbf9-4c7b-884e-e35fb471c232" class="myscreencast-iframe iframe-container active-myscreencast"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/9cc890f3-cbf9-4c7b-884e-e35fb471c232" width="640" height="620" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" style="display: inline;"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;
&lt;DIV class="myscreencast-iframe iframe-container active-myscreencast"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="myscreencast-iframe iframe-container active-myscreencast"&gt;and I tried to call the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;recomputeDimBlock&lt;/EM&gt;&lt;SPAN&gt; method like this. But the result is the same...&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="myscreencast-iframe iframe-container active-myscreencast"&gt;
&lt;PRE&gt;void CDwgDatabaseUtil::RedrawAllEntitys1(AcDbDatabase *pDb)
{
	// 获取块表
	AcDbBlockTable *pBlkTbl = NULL;
	pDb-&amp;gt;getBlockTable(pBlkTbl, AcDb::kForRead);

	// 创建遍历器，依次访问块表中的每条块表记录
	AcDbBlockTableIterator *it = NULL;
	pBlkTbl-&amp;gt;newIterator(it);
	for (it-&amp;gt;start(); !it-&amp;gt;done(); it-&amp;gt;step())
	{
		//获取某条块表记录
		AcDbBlockTableRecord *pBlkTblRcd = NULL;
		it-&amp;gt;getRecord(pBlkTblRcd, AcDb::kForRead);
		// 创建遍历器，依次访问块表记录中的每一个实体
		AcDbBlockTableRecordIterator *rcdIt = NULL;
		pBlkTblRcd-&amp;gt;newIterator(rcdIt);
		for (rcdIt-&amp;gt;start(); !rcdIt-&amp;gt;done(); rcdIt-&amp;gt;step())
		{
			AcDbEntity *pEnt = NULL;
			if (Acad::eOk == rcdIt-&amp;gt;getEntity(pEnt, AcDb::kForWrite))
			{
				if (pEnt-&amp;gt;isKindOf(AcDbDimension::desc()))
				{
					AcDbDimension *pDim = AcDbDimension::cast(pEnt);
					pDim-&amp;gt;recomputeDimBlock(true);
				}
				//pEnt-&amp;gt;recordGraphicsModified(true);
				pEnt-&amp;gt;close();
			}
		}
		delete rcdIt;
		pBlkTblRcd-&amp;gt;close();
	}
	delete it;
	pBlkTbl-&amp;gt;close();
}&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;DIV class="myscreencast-iframe iframe-container active-myscreencast"&gt;&lt;SPAN&gt;So what is problem in my code?&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 14 Jan 2017 09:26:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6805489#M9010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-14T09:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6805492#M9011</link>
      <description>&lt;P&gt;The screemcast is so good.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2017 09:30:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6805492#M9011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-14T09:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6805760#M9012</link>
      <description>&lt;P&gt;Try to compare your code with my:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;//-----------------------------------------------------------------------------
//----- acrxEntryPoint.cpp
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "resource.h"
//-----------------------------------------------------------------------------
#define szRDS _RXST("")
//-----------------------------------------------------------------------------
//----- ObjectARX EntryPoint
class CWblockDimApp : public AcRxArxApp {
public:
  CWblockDimApp () : AcRxArxApp () {}
  virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
    AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg (pkt) ;
    return (retCode) ;
  }
  virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
    AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;
    return (retCode) ;
  }

  virtual void RegisterServerComponents () { }
  // - WblockDim.WPTEST command (do not rename)
  static void WblockDimWPTEST(void)
  {
    Acad::ErrorStatus es;
    CString strTargetFileFullPath = TEXT("D:\\test.dwg");

    //create the new file
    AcDbDatabase *pNewDb = new AcDbDatabase(true, false);
    es = pNewDb-&amp;gt;saveAs(strTargetFileFullPath);
    delete pNewDb;

    // get the targetDb, sourceDb and tempDb
    AcDbDatabase *pTargetDb = new AcDbDatabase(false);
    pTargetDb-&amp;gt;readDwgFile(strTargetFileFullPath);
    AcDbDatabase *pSourceDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();
    AcDbDatabase *pTempDb = NULL;
    es = pSourceDb-&amp;gt;wblock(pTempDb);
    // get the entities that need clone
    AcDbObjectIdArray idsNeedClone;
    AcDbBlockTable *pBlkTbl = NULL;
    pTempDb-&amp;gt;getBlockTable(pBlkTbl, AcDb::kForRead);
    AcDbBlockTableRecord *pBlkTblRcd = NULL;
    pBlkTbl-&amp;gt;getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForRead);
    pBlkTbl-&amp;gt;close();
    AcDbBlockTableRecordIterator *it = NULL;
    pBlkTblRcd-&amp;gt;newIterator(it);
    pBlkTblRcd-&amp;gt;close();

    for (it-&amp;gt;start(); !it-&amp;gt;done(); it-&amp;gt;step())
    {
      AcDbObjectId id;
      if (Acad::eOk != it-&amp;gt;getEntityId(id)) continue;
      idsNeedClone.append(id);
    }
    delete it;

    // clone from tempDb to targetDb
    pTempDb-&amp;gt;wblock(pTargetDb, idsNeedClone, AcGePoint3d::kOrigin, AcDb::kDrcReplace);

    //redraw the entities in targetDb and saveas
    RedrawAllEntities(pTargetDb);
    es = pTargetDb-&amp;gt;closeInput(true);
    es = acdbSaveAs2004(pTargetDb, strTargetFileFullPath);

    delete pTargetDb;
    delete pTempDb;

  }
  static void RedrawAllEntities(AcDbDatabase *pDb)
  {
    AcDbDatabase *pCurDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();
    acdbHostApplicationServices()-&amp;gt;setWorkingDatabase(pDb);
    AcDbBlockTable *pBlkTbl = NULL;
    pDb-&amp;gt;getBlockTable(pBlkTbl, AcDb::kForRead);
    AcDbBlockTableIterator *it = NULL;
    pBlkTbl-&amp;gt;newIterator(it);
    pBlkTbl-&amp;gt;close();

    for (it-&amp;gt;start(); !it-&amp;gt;done(); it-&amp;gt;step())
    {
      AcDbBlockTableRecord *pBlkTblRcd = NULL;
      it-&amp;gt;getRecord(pBlkTblRcd, AcDb::kForRead);
      AcDbBlockTableRecordIterator *rcdIt = NULL;
      pBlkTblRcd-&amp;gt;newIterator(rcdIt);
      pBlkTblRcd-&amp;gt;close();
      for (rcdIt-&amp;gt;start(); !rcdIt-&amp;gt;done(); rcdIt-&amp;gt;step())
      {
        AcDbEntity *pEnt = NULL;
        if (Acad::eOk == rcdIt-&amp;gt;getEntity(pEnt, AcDb::kForWrite))
        {
          if (pEnt-&amp;gt;isKindOf(AcDbDimension::desc()))
          {
            AcDbDimension *pDim = AcDbDimension::cast(pEnt);
            pDim-&amp;gt;recomputeDimBlock(true);
          }
          pEnt-&amp;gt;recordGraphicsModified(true);
          pEnt-&amp;gt;close();
        }
      }
      delete rcdIt;
    }
    delete it;
    acdbHostApplicationServices()-&amp;gt;setWorkingDatabase(pCurDb);
  }
} ;

//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CWblockDimApp)
ACED_ARXCOMMAND_ENTRY_AUTO(CWblockDimApp, WblockDim, WPTEST, WPTEST, ACRX_CMD_TRANSPARENT, NULL)
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="iframe-container"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/ba3f45bf-c319-479c-a6e4-46c60aabf321" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" style="display: inline;" width="640" height="620" frameborder="0"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;P.S.: You have to close AcDbBlockTable and AcDbBlockTableRecord just they are not needed.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2017 16:07:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6805760#M9012</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-01-14T16:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6805806#M9013</link>
      <description>&lt;P&gt;Other variant of RedrawAllEntities:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;static void RedrawAllEntities(AcDbDatabase *pDb)
{
  AcDbBlockTable *pBlkTbl = NULL;
  pDb-&amp;gt;getBlockTable(pBlkTbl, AcDb::kForRead);
  AcDbBlockTableIterator *it = NULL;
  if (pBlkTbl) {
    pBlkTbl-&amp;gt;newIterator(it);
    pBlkTbl-&amp;gt;close();
  }

  if (!it) return;

  AcDbObjectIdArray idsDim, idsTable;

  for (it-&amp;gt;start(); !it-&amp;gt;done(); it-&amp;gt;step())
  {
    AcDbBlockTableRecord *pBlkTblRcd = NULL;
    it-&amp;gt;getRecord(pBlkTblRcd, AcDb::kForRead);
    if (pBlkTblRcd) {
      AcDbBlockTableRecordIterator *rcdIt = NULL;
      pBlkTblRcd-&amp;gt;newIterator(rcdIt);
      pBlkTblRcd-&amp;gt;close();
  
      if (!rcdIt) continue;

      for (rcdIt-&amp;gt;start(); !rcdIt-&amp;gt;done(); rcdIt-&amp;gt;step()) {
        AcDbObjectId id;
        if (rcdIt-&amp;gt;getEntityId(id) == Acad::eOk) {
          if (id.objectClass()-&amp;gt;isDerivedFrom(AcDbDimension::desc())) {
            idsDim.append(id);
          } else if (id.objectClass()-&amp;gt;isDerivedFrom(AcDbTable::desc())) {
            idsTable.append(id);
          }
        }
      }
      delete rcdIt;
    }
  }
  
  delete it;
  
  AcDbDatabase *pWorkDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();
  acdbHostApplicationServices()-&amp;gt;setWorkingDatabase(pDb);
  
  for (int i = 0; i &amp;lt; idsDim.length(); i++) {
    AcDbObjectPointer&amp;lt;AcDbDimension&amp;gt; pDim(idsDim[i], AcDb::kForWrite);
    if (pDim.openStatus() == Acad::eOk) {
      pDim-&amp;gt;recomputeDimBlock(true);
    }
  }

  for (int i = 0; i &amp;lt; idsTable.length(); i++) {
    AcDbObjectPointer&amp;lt;AcDbTable&amp;gt; pTable(idsTable[i], AcDb::kForWrite);
    if (pTable.openStatus() == Acad::eOk) {
      pTable-&amp;gt;recomputeTableBlock(true);
    }
  }
  
  acdbHostApplicationServices()-&amp;gt;setWorkingDatabase(pWorkDb);

}
&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Jan 2017 17:12:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6805806#M9013</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-01-14T17:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6806177#M9014</link>
      <description>&lt;P&gt;Thank you, Alex!&lt;/P&gt;&lt;P&gt;And now, it works. Comparing my code with yours, I find the key point is these changes&lt;/P&gt;&lt;P&gt;1. let the pDb to be the working database.&lt;/P&gt;&lt;PRE&gt;acdbHostApplicationServices()-&amp;gt;setWorkingDatabase(pDb);&lt;/PRE&gt;&lt;P&gt;2. recomputeDimBlock&lt;/P&gt;&lt;PRE&gt;AcDbDimension *pDim = AcDbDimension::cast(pEnt);
pDim-&amp;gt;recomputeDimBlock(true);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;About the first point, the doc of AcDbDimension::recomputeDimBlock Function is this&lt;/P&gt;&lt;PRE&gt;Acad::ErrorStatus

recomputeDimBlock(

bool forceUpdate = true);

forceUpdate Input Boolean indicating whether or not to force an update on screen 

This function updates the block table record the dimension references to match any changes made to the dimension since the last time the block table record was updated.

If forceUpdate==true, then the block table record will be updated regardless of whether or not the dimension has had any changes since the last time the block table record was updated. If forceUpdate==false, then the block table record will only be updated if the dimension has been changed since it was opened, is not currently erased, and is not in the middle of an Undo operation.

This function returns Acad::eOk.&lt;/PRE&gt;&lt;P&gt;But it tells me nothing about the setting og working database. So, my question is, what's the reason to let you change the working database?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2017 03:52:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6806177#M9014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-15T03:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6806895#M9015</link>
      <description>&lt;P&gt;3. (very important) I close AcDbBlockTable and AcDbBlockTableRecord immediately after receiving their iterator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&amp;gt;&amp;gt;&amp;gt;But it tells me nothing about the setting og working database. So, my question is, what's the reason to let you change the working database?&amp;lt;&amp;lt;&amp;lt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is often necessary when working with side AcDbDatabase (not opened in AutoCAD Editor or not current).&amp;nbsp; But in this case it is not necessary.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2017 22:09:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6806895#M9015</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-01-15T22:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why the dimensions not show?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6807054#M9016</link>
      <description>OH, I should try it again without the setting of database.</description>
      <pubDate>Mon, 16 Jan 2017 03:19:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/why-the-dimensions-not-show/m-p/6807054#M9016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-16T03:19:16Z</dc:date>
    </item>
  </channel>
</rss>

