<?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: Updating block ref graphics in middle of iteration (psuedo  animation) in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119036#M20325</link>
    <description>This is how you would call the regen command from within ARX:&lt;BR /&gt;
&lt;BR /&gt;
acedCommand( RTSTR, _T("_.regen"), RTNONE );&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUGK16&gt; wrote in message news:5780143@discussion.autodesk.com...&lt;BR /&gt;
I've tried various combinations of these functions...&lt;BR /&gt;
&lt;BR /&gt;
acdbQueueForRegen( &amp;amp;id, 1);&lt;BR /&gt;
actrTransactionManager-&amp;gt;queueForGraphicsFlush();&lt;BR /&gt;
actrTransactionManager-&amp;gt;flushGraphics();&lt;BR /&gt;
acedUpdateDisplay();&lt;BR /&gt;
objPtr-&amp;gt;draw();&lt;BR /&gt;
&lt;BR /&gt;
...but nothing happens during the actual function execution.  Only when the &lt;BR /&gt;
function stops executing do I see any changes, i.e. the full transformation &lt;BR /&gt;
I applied, not the incremental steps.&lt;BR /&gt;
&lt;BR /&gt;
So maybe this regen thing is the way to go...can u point me to a sample or &lt;BR /&gt;
example in the ARX docs?&lt;/DOUGK16&gt;</description>
    <pubDate>Sat, 17 Nov 2007 00:18:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-11-17T00:18:44Z</dc:date>
    <item>
      <title>Updating block ref graphics in middle of iteration (psuedo animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119033#M20322</link>
      <description>So what I'm trying to do is to create a psuedo animation of a block reference undergoing a transformation.&lt;BR /&gt;
&lt;BR /&gt;
Step (0): open the ref for write&lt;BR /&gt;
Step (1): erase the ref's old block record and make a new one&lt;BR /&gt;
Step (2): somehow flush graphics so that the ref with its updated block record is drawn on the model space&lt;BR /&gt;
Step (3): Sleep() for a small period of time&lt;BR /&gt;
Step (4): repeat first three steps n times, with a transformation between each iteration&lt;BR /&gt;
&lt;BR /&gt;
Step (2) is what eludes me.  I've tried various things like draw() and assertWriteEnabled(), but to no avail.&lt;BR /&gt;
&lt;BR /&gt;
I know that creating new block records after each iteration doesn't seem necessary, but for rather more complicated reasons, this must be done.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any input!</description>
      <pubDate>Fri, 16 Nov 2007 19:01:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119033#M20322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-16T19:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119034#M20323</link>
      <description>You can try these two calls:  actrTransactionManager-&amp;gt;flushGraphics(); and &lt;BR /&gt;
acedUpdateDisplay();&lt;BR /&gt;
&lt;BR /&gt;
If they don't work, you may have to call a regen.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUGK16&gt; wrote in message news:5779956@discussion.autodesk.com...&lt;BR /&gt;
So what I'm trying to do is to create a psuedo animation of a block &lt;BR /&gt;
reference undergoing a transformation.&lt;BR /&gt;
&lt;BR /&gt;
Step (0): open the ref for write&lt;BR /&gt;
Step (1): erase the ref's old block record and make a new one&lt;BR /&gt;
Step (2): somehow flush graphics so that the ref with its updated block &lt;BR /&gt;
record is drawn on the model space&lt;BR /&gt;
Step (3): Sleep() for a small period of time&lt;BR /&gt;
Step (4): repeat first three steps n times, with a transformation between &lt;BR /&gt;
each iteration&lt;BR /&gt;
&lt;BR /&gt;
Step (2) is what eludes me.  I've tried various things like draw() and &lt;BR /&gt;
assertWriteEnabled(), but to no avail.&lt;BR /&gt;
&lt;BR /&gt;
I know that creating new block records after each iteration doesn't seem &lt;BR /&gt;
necessary, but for rather more complicated reasons, this must be done.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any input!&lt;/DOUGK16&gt;</description>
      <pubDate>Fri, 16 Nov 2007 20:37:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119034#M20323</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-16T20:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119035#M20324</link>
      <description>I've tried various combinations of these functions...&lt;BR /&gt;
&lt;BR /&gt;
acdbQueueForRegen( &amp;amp;id, 1);&lt;BR /&gt;
actrTransactionManager-&amp;gt;queueForGraphicsFlush();&lt;BR /&gt;
actrTransactionManager-&amp;gt;flushGraphics();&lt;BR /&gt;
acedUpdateDisplay();&lt;BR /&gt;
objPtr-&amp;gt;draw();&lt;BR /&gt;
&lt;BR /&gt;
...but nothing happens during the actual function execution.  Only when the function stops executing do I see any changes, i.e. the full transformation I applied, not the incremental steps.&lt;BR /&gt;
&lt;BR /&gt;
So maybe this regen thing is the way to go...can u point me to a sample or example in the ARX docs?</description>
      <pubDate>Fri, 16 Nov 2007 22:09:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119035#M20324</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-16T22:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119036#M20325</link>
      <description>This is how you would call the regen command from within ARX:&lt;BR /&gt;
&lt;BR /&gt;
acedCommand( RTSTR, _T("_.regen"), RTNONE );&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUGK16&gt; wrote in message news:5780143@discussion.autodesk.com...&lt;BR /&gt;
I've tried various combinations of these functions...&lt;BR /&gt;
&lt;BR /&gt;
acdbQueueForRegen( &amp;amp;id, 1);&lt;BR /&gt;
actrTransactionManager-&amp;gt;queueForGraphicsFlush();&lt;BR /&gt;
actrTransactionManager-&amp;gt;flushGraphics();&lt;BR /&gt;
acedUpdateDisplay();&lt;BR /&gt;
objPtr-&amp;gt;draw();&lt;BR /&gt;
&lt;BR /&gt;
...but nothing happens during the actual function execution.  Only when the &lt;BR /&gt;
function stops executing do I see any changes, i.e. the full transformation &lt;BR /&gt;
I applied, not the incremental steps.&lt;BR /&gt;
&lt;BR /&gt;
So maybe this regen thing is the way to go...can u point me to a sample or &lt;BR /&gt;
example in the ARX docs?&lt;/DOUGK16&gt;</description>
      <pubDate>Sat, 17 Nov 2007 00:18:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119036#M20325</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-17T00:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119037#M20326</link>
      <description>this regen thing doesn't work either, in fact it makes things act pretty strange...at the end of the code execution the block ref gets transformed correctly, but references the same block table record as it started with...&lt;BR /&gt;
&lt;BR /&gt;
thanks for your suggestions so far, but i'm starting to think that there may not be a solution to this</description>
      <pubDate>Sat, 17 Nov 2007 05:53:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119037#M20326</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-17T05:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119038#M20327</link>
      <description>Howdy doug,&lt;BR /&gt;
&lt;BR /&gt;
Since blocks and block refs derive from AcGiDrawable you can use the AcGs api to do this.&lt;BR /&gt;
&lt;BR /&gt;
Start with AcGsModel::onModified on the ref...&lt;BR /&gt;
acgsGetGsManager()-&amp;gt;getDBModel()-&amp;gt;onModified(pBlockRef, NULL);&lt;BR /&gt;
&lt;BR /&gt;
you may also need... AcGsModel::invalidate(AcGsModel::kInvalidateAll).&lt;BR /&gt;
&lt;BR /&gt;
and if it still doesn't work, try...&lt;BR /&gt;
AcGsModel::onErased(pBlock, NULL) when you erase the block.&lt;BR /&gt;
&lt;BR /&gt;
It's definitely do-able, you just gotta get it all in the right order and not use the AcEd editor api at alll.  Use only the AcGs api and make sure you don't have the block or block ref opened for write outside of a transaction when you call into the AcGs notifications.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Andy F.</description>
      <pubDate>Sat, 17 Nov 2007 18:02:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119038#M20327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-17T18:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119039#M20328</link>
      <description>This doesn't work either, but I may be putting the calls in the wrong place.  I'm basically putting them (invalidate and onModified) right after the ref sets its new block table record.  It'd take too long to explain, but suffice it to say that I can't use onErased because where/when/if the block record is erased isn't exposed to me.&lt;BR /&gt;
&lt;BR /&gt;
Also, I do everything within a transaction...maybe that's causing some problem with this AcGs api not updating the screen?&lt;BR /&gt;
&lt;BR /&gt;
I'm sure there's some way to do it, but I've just pulled too many hairs trying to get such a trivial effect to occur &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sat, 17 Nov 2007 20:07:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119039#M20328</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-17T20:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119040#M20329</link>
      <description>Doug,&lt;BR /&gt;
&lt;BR /&gt;
I just looked over some of my code where I change a block definition.  To &lt;BR /&gt;
get the block references to regen without regening the entire drawing, I &lt;BR /&gt;
simply call pEnt-&amp;gt;setVisibility( AcDb::kInvisible ) and then &lt;BR /&gt;
pEnt-&amp;gt;setVisiblity( AcDb::kVisible ).  Make sure pEnt (which is an &lt;BR /&gt;
AcDbEntity) is opened on the block reference.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUGK16&gt; wrote in message news:5780440@discussion.autodesk.com...&lt;BR /&gt;
This doesn't work either, but I may be putting the calls in the wrong place. &lt;BR /&gt;
I'm basically putting them (invalidate and onModified) right after the ref &lt;BR /&gt;
sets its new block table record.  It'd take too long to explain, but suffice &lt;BR /&gt;
it to say that I can't use onErased because where/when/if the block record &lt;BR /&gt;
is erased isn't exposed to me.&lt;BR /&gt;
&lt;BR /&gt;
Also, I do everything within a transaction...maybe that's causing some &lt;BR /&gt;
problem with this AcGs api not updating the screen?&lt;BR /&gt;
&lt;BR /&gt;
I'm sure there's some way to do it, but I've just pulled too many hairs &lt;BR /&gt;
trying to get such a trivial effect to occur &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/DOUGK16&gt;</description>
      <pubDate>Sat, 17 Nov 2007 20:16:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119040#M20329</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-17T20:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119041#M20330</link>
      <description>Joe, thanks for your suggestions so far, but I couldn't get this to work either.  Just to be clear, I do this resetting of invisibility *only* right?  So not in combination with any other suggestion(s) in this thread?&lt;BR /&gt;
&lt;BR /&gt;
And I do it just on the block reference right, not on anything else (e.g. the entities contained by the block record) ?</description>
      <pubDate>Sat, 17 Nov 2007 22:53:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119041#M20330</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-17T22:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119042#M20331</link>
      <description>all the suggestions should work so there must be something else going on we're not aware of.</description>
      <pubDate>Sat, 17 Nov 2007 23:24:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119042#M20331</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-17T23:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119043#M20332</link>
      <description>I do the actrTransactionManager-&amp;gt;flushGraphics(); and acedUpdateDisplay(); &lt;BR /&gt;
after I close the block table record and then do the Invisible, Visible set. &lt;BR /&gt;
If you just set to Visible, that won't do it.  You have to set it to &lt;BR /&gt;
Invisible and then back to Visible.&lt;BR /&gt;
&lt;BR /&gt;
If you post your code here, we may be able to see what the problem might be.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
&lt;BR /&gt;
&lt;DOUGK16&gt; wrote in message news:5780463@discussion.autodesk.com...&lt;BR /&gt;
Joe, thanks for your suggestions so far, but I couldn't get this to work &lt;BR /&gt;
either.  Just to be clear, I do this resetting of invisibility *only* right? &lt;BR /&gt;
So not in combination with any other suggestion(s) in this thread?&lt;BR /&gt;
&lt;BR /&gt;
And I do it just on the block reference right, not on anything else (e.g. &lt;BR /&gt;
the entities contained by the block record) ?&lt;/DOUGK16&gt;</description>
      <pubDate>Sun, 18 Nov 2007 00:05:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119043#M20332</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-18T00:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Updating block ref graphics in middle of iteration (psuedo  animation)</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119044#M20333</link>
      <description>As Andy below says, there must be something else going on, cause this doesn't work either.  Thank you both for your help in trying to solve this problem though.&lt;BR /&gt;
&lt;BR /&gt;
I would post my code but for the fact that the functions which do the actual block manipulation are pretty complex and nested.  The function itself in which I'm attempting this graphics updating is simple, just a command interface, but for you to get the complete picture I'd probably have to send you the whole project, which would take you a while to decipher and is under non-disclosure besides.&lt;BR /&gt;
&lt;BR /&gt;
Could it be that the problem is I'm not doing this graphics updating in the same function as where I actually set the blocks, but in the calling function?&lt;BR /&gt;
&lt;BR /&gt;
Eh I guess this one will be put on the back burner for a while, at least until I rebuild my patience levels &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sun, 18 Nov 2007 00:44:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/updating-block-ref-graphics-in-middle-of-iteration-psuedo/m-p/2119044#M20333</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-18T00:44:17Z</dc:date>
    </item>
  </channel>
</rss>

