<?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: AcDbSummaryInfoReactor - how does it work? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6495994#M9763</link>
    <description>&lt;P&gt;To answer my own question... I misunderstood the behaviour. It is still strange but slightly easier to deal with. If I wait until the code hits the reactor the final time, it has built a complete set of changed fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I need to use a static counter to tell which is the last iteration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;//------------------------------------------------------------------------------
void SummaryInfoReactor::summaryInfoHasChanged(const AcDbDatabase* pDb, const AcDbDatabaseSummaryInfo* pSummaryInfo)
//------------------------------------------------------------------------------
{
  m_nIndexCounter++;

  int nInfo = pSummaryInfo-&amp;gt;numCustomInfo();
  if (m_nIndexCounter == nInfo)
  {
    m_nIndexCounter = 0;
  }
  else if (m_nIndexCounter == nInfo - 1)
  {
    DocDataManager.docData()-&amp;gt;SyncCustomSummaryInfo(pSummaryInfo);
  }
}&lt;/PRE&gt;</description>
    <pubDate>Fri, 12 Aug 2016 05:34:52 GMT</pubDate>
    <dc:creator>Kyudos</dc:creator>
    <dc:date>2016-08-12T05:34:52Z</dc:date>
    <item>
      <title>AcDbSummaryInfoReactor - how does it work?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6479771#M9758</link>
      <description>&lt;P&gt;I'm attempting to use an&amp;nbsp;&lt;STRONG&gt;AcDbSummaryInfoReactor&lt;/STRONG&gt; and I'm having a few problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I can tell&amp;nbsp;&lt;STRONG&gt;summaryInfoHasChanged&lt;/STRONG&gt; is called when the &lt;STRONG&gt;Drawing Properties&lt;/STRONG&gt; dialog is OK'd - regardless of whether any changes have been made.&lt;/P&gt;
&lt;P&gt;It also seems to be called (unnecessarily?) multiple times - at a guess, once for every Custom Property I have defined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Further, if in my &lt;STRONG&gt;summaryInfoHasChanged&lt;/STRONG&gt;&amp;nbsp; handler I use&amp;nbsp;&lt;STRONG&gt;getCustomSummaryInfo&lt;/STRONG&gt; to get the value of the custom property I know I just changed, it only returns the new value on the correct iteration (i.e., if I change the fourth custom property I only get the correct value on the fourth run through the handler otherwise i get the old value).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you tell which value is currently the one being changed? So I can avoid overwriting it with the old value on subsequent iterations...?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 03:19:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6479771#M9758</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-05T03:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbSummaryInfoReactor - how does it work?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6479779#M9759</link>
      <description>&lt;P&gt;OK - I've discovered that if I use the&amp;nbsp;&lt;STRONG&gt;AcDbDatabaseSummaryInfo&lt;/STRONG&gt; pointer from the reactor against the current one from&amp;nbsp;&lt;STRONG&gt;acdbGetSummaryInfo,&lt;/STRONG&gt; I can tell when a value changes (get the name and value from the reactor, compare against the value&amp;nbsp;from the current set). However, this involves iterating over the entire set each time the handler is hit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really hope there is a better way to do this....&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 03:40:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6479779#M9759</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-05T03:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbSummaryInfoReactor - how does it work?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6480158#M9760</link>
      <description>&lt;P&gt;Did you add&amp;nbsp;the same reactor multiple times?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 10:30:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6480158#M9760</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2016-08-05T10:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbSummaryInfoReactor - how does it work?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6482939#M9761</link>
      <description>&lt;P&gt;Hi Owen,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nope - only once. To be honest, looking at the function definition, I was only expecting it to hit&amp;nbsp;&lt;STRONG&gt;summaryInfoHasChanged&lt;/STRONG&gt; once, with a pointer to the whole set of changed (new) data. Finding it hitting the function multiple times, I then thought there must be something that identifies which field is changing each time - but I can't find it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2016 21:54:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6482939#M9761</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-07T21:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbSummaryInfoReactor - how does it work?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6495940#M9762</link>
      <description>&lt;P&gt;Any advance on this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it really meant to work the way it (apparently) does?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 04:09:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6495940#M9762</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-12T04:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: AcDbSummaryInfoReactor - how does it work?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6495994#M9763</link>
      <description>&lt;P&gt;To answer my own question... I misunderstood the behaviour. It is still strange but slightly easier to deal with. If I wait until the code hits the reactor the final time, it has built a complete set of changed fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I need to use a static counter to tell which is the last iteration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;//------------------------------------------------------------------------------
void SummaryInfoReactor::summaryInfoHasChanged(const AcDbDatabase* pDb, const AcDbDatabaseSummaryInfo* pSummaryInfo)
//------------------------------------------------------------------------------
{
  m_nIndexCounter++;

  int nInfo = pSummaryInfo-&amp;gt;numCustomInfo();
  if (m_nIndexCounter == nInfo)
  {
    m_nIndexCounter = 0;
  }
  else if (m_nIndexCounter == nInfo - 1)
  {
    DocDataManager.docData()-&amp;gt;SyncCustomSummaryInfo(pSummaryInfo);
  }
}&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Aug 2016 05:34:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/acdbsummaryinforeactor-how-does-it-work/m-p/6495994#M9763</guid>
      <dc:creator>Kyudos</dc:creator>
      <dc:date>2016-08-12T05:34:52Z</dc:date>
    </item>
  </channel>
</rss>

