<?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: Slow display regeneration when disabling AcDbVisibilityOverrule in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8741859#M5492</link>
    <description>&lt;P&gt;It is not suprisingly slow. It is slow, because there are more then 11.000 Entities in the drawing. These objects are of custom type. They work like a block reference, pointing to an unonymous block. This block contains a polyline and a hatch. So there are about 33.000 entities and 11.000 blocks involved.&lt;/P&gt;
&lt;P&gt;I'm searching for a way to clear the view without processing all entities. Maybe by limiting the working area. Or for maybe I can delay the processing in some way not unhiding them all at once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2019 12:05:29 GMT</pubDate>
    <dc:creator>fehrsZBFB9</dc:creator>
    <dc:date>2019-04-19T12:05:29Z</dc:date>
    <item>
      <title>Slow display regeneration when disabling AcDbVisibilityOverrule</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8737207#M5488</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;
&lt;P&gt;I'm using a AcDbVisibilityOverrule to temporarily hide all Entities in the drawing except a small set.&lt;/P&gt;
&lt;P&gt;This Process is slow for big Drawings. Do you know a way to speed up the unhiding process?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 13:19:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8737207#M5488</guid>
      <dc:creator>fehrsZBFB9</dc:creator>
      <dc:date>2019-04-17T13:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Slow display regeneration when disabling AcDbVisibilityOverrule</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8739270#M5489</link>
      <description>&lt;P&gt;the fastest way to hide/show entities is to use &lt;STRONG&gt;AcDbEntity::setVisibility(AcDb::kVisible/AcDb::kInvisible)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 07:13:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8739270#M5489</guid>
      <dc:creator>nick83</dc:creator>
      <dc:date>2019-04-18T07:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Slow display regeneration when disabling AcDbVisibilityOverrule</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8739624#M5490</link>
      <description>&lt;P&gt;I tried to hide all entities in the database traversing the database and call setVisibility for them. This lead to a delay when hiding AND unhiding the objects. Using AcDbVisibilityOverrule only lead to a delay when unhiding the objects when calling. I also tried to use a AcGiDrawableOverrule with empty worldDraw and viewportDraw routines. It worked but wasn't faster.&lt;/P&gt;
&lt;P&gt;Thanks anyway. As you said, there seems to be no faster solution. I compared it with the block editor. It's equaly slow when closed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe I can limit the area of my Jig operation. Currently the user can zoom out as far as he likes. This doesn't make sense. When the area is limited, I could only hide entities inside that area. Which could be a lot faster. Any ideas about that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Martin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 10:23:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8739624#M5490</guid>
      <dc:creator>fehrsZBFB9</dc:creator>
      <dc:date>2019-04-18T10:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Slow display regeneration when disabling AcDbVisibilityOverrule</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8740113#M5491</link>
      <description>&lt;P&gt;I would also expect that using &lt;FONT face="courier new,courier"&gt;AcDbEntity::setVisibility()&lt;/FONT&gt; is the most performant way to change visibilities.&lt;/P&gt;
&lt;P&gt;The show/hide performance should be comparable to thawing/freezing layers.&lt;/P&gt;
&lt;P&gt;When you tried &lt;FONT face="courier new,courier"&gt;setVisibility()&lt;/FONT&gt;, did you force the GS (graphic system) somehow to update each entity after you changed its visibility? I.e. by calling &lt;FONT face="courier new,courier"&gt;AcDbEntity::draw() /&amp;nbsp;AcDbEntity::recordGraphicsModified() / acedUpdateDisplay() / actrTransactionManager.flushGraphics() / acedRedraw()&lt;/FONT&gt; / ...?&amp;nbsp; This would slow down the performance. It is better to do all changes within a transaction and let the GS do the update for all modified entities at once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to test performance with this simple code that hides/shows all modelspace entities on layer 0:&lt;/P&gt;
&lt;PRE&gt;void visOnLayerId(AcDbObjectId idLayer, AcDb::Visibility vis)
{
	AcDbDatabase *pDB = acdbHostApplicationServices()-&amp;gt;workingDatabase();
	AcDbObjectId IdModelSpace = acdbSymUtil()-&amp;gt;blockModelSpaceId(pDB);
	AcDbBlockTableRecord *model;
	Acad::ErrorStatus es;
	if ( (es=acdbOpenObject(model, IdModelSpace, AcDb::kForRead)) == Acad::eOk )
	{
		AcDbBlockTableRecordIterator *pit;
		es = model-&amp;gt;newIterator(pit);
		if (pit)
		{
			for (pit-&amp;gt;start(); !pit-&amp;gt;done(); pit-&amp;gt;step())
			{
				AcDbEntity *entity=nullptr;
				es = pit-&amp;gt;getEntity(entity, AcDb::kForRead);
				if (!es)
				{
					if (entity-&amp;gt;layerId() == idLayer)
					{
						if (entity-&amp;gt;visibility()!=vis)
						{
							if (!entity-&amp;gt;upgradeOpen())
								entity-&amp;gt;setVisibility(vis);
						}
					}
					entity-&amp;gt;close();
				}
			}
			delete pit;
		}
		model-&amp;gt;close();		
	}	
}

void cmdHide()
{
	AcDbDatabase *pDB = acdbHostApplicationServices()-&amp;gt;workingDatabase();
	AcDbObjectId idLayer0 = acdbSymUtil()-&amp;gt;layerZeroId(pDB);
	visOnLayerId(idLayer0, AcDb::kInvisible);
}

void cmdShow()
{
	AcDbDatabase *pDB = acdbHostApplicationServices()-&amp;gt;workingDatabase();
	AcDbObjectId idLayer0 = acdbSymUtil()-&amp;gt;layerZeroId(pDB);
	visOnLayerId(idLayer0, AcDb::kVisible);
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 14:08:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8740113#M5491</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2019-04-18T14:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Slow display regeneration when disabling AcDbVisibilityOverrule</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8741859#M5492</link>
      <description>&lt;P&gt;It is not suprisingly slow. It is slow, because there are more then 11.000 Entities in the drawing. These objects are of custom type. They work like a block reference, pointing to an unonymous block. This block contains a polyline and a hatch. So there are about 33.000 entities and 11.000 blocks involved.&lt;/P&gt;
&lt;P&gt;I'm searching for a way to clear the view without processing all entities. Maybe by limiting the working area. Or for maybe I can delay the processing in some way not unhiding them all at once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2019 12:05:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/slow-display-regeneration-when-disabling-acdbvisibilityoverrule/m-p/8741859#M5492</guid>
      <dc:creator>fehrsZBFB9</dc:creator>
      <dc:date>2019-04-19T12:05:29Z</dc:date>
    </item>
  </channel>
</rss>

