<?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 Associative hatch in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/associative-hatch/m-p/13782380#M44109</link>
    <description>&lt;P&gt;I have spent all day trying to make an associative hatch and it just doesn't work. It says it is associative in properties panel but doesn't behave as one. I came across &lt;A title="https://adndevblog.typepad.com/autocad/2013/01/associativity-acdbhatch.html" href="https://adndevblog.typepad.com/autocad/2013/01/associativity-acdbhatch.html" target="_blank" rel="noopener"&gt;this&lt;/A&gt; but have not tried it yet. I think it should be possible to make associative hatch without involving reactors. Can anyone point me in the right direction. I am not sure what I am doing wrong. Please help. Note that the boundary is a simple close polyline.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;bool AssociativeHatch(const AcDbObjectId&amp;amp; bdryId)
{
	AcDbHatch* pHatch = new AcDbHatch();
	pHatch-&amp;gt;setDatabaseDefaults();
	pHatch-&amp;gt;setAssociative(Adesk::kTrue);
	
	AcDbObjectIdArray boundaryIds;
	boundaryIds.append(bdryId);

	pHatch-&amp;gt;appendLoop(AcDbHatch::kExternal, boundaryIds);
	pHatch-&amp;gt;setPattern(AcDbHatch::kPreDefined, _T("_SOLID"));
	pHatch-&amp;gt;evaluateHatch();

	AcDbDatabase* pDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();
	AcDbBlockTable* pBlockTable = NULL;
	AcDbBlockTableRecord* pMSpaceRecord = NULL;
	pDb-&amp;gt;getSymbolTable(pBlockTable, AcDb::kForRead);
	pBlockTable-&amp;gt;getAt(ACDB_MODEL_SPACE, pMSpaceRecord, AcDb::kForWrite);

	AcDbObjectId hatchId;
	pMSpaceRecord-&amp;gt;appendAcDbEntity(hatchId, pHatch);
	pMSpaceRecord-&amp;gt;close();

	pHatch-&amp;gt;close();
	return true;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Aug 2025 22:44:42 GMT</pubDate>
    <dc:creator>karl.sch1983</dc:creator>
    <dc:date>2025-08-25T22:44:42Z</dc:date>
    <item>
      <title>Associative hatch</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/associative-hatch/m-p/13782380#M44109</link>
      <description>&lt;P&gt;I have spent all day trying to make an associative hatch and it just doesn't work. It says it is associative in properties panel but doesn't behave as one. I came across &lt;A title="https://adndevblog.typepad.com/autocad/2013/01/associativity-acdbhatch.html" href="https://adndevblog.typepad.com/autocad/2013/01/associativity-acdbhatch.html" target="_blank" rel="noopener"&gt;this&lt;/A&gt; but have not tried it yet. I think it should be possible to make associative hatch without involving reactors. Can anyone point me in the right direction. I am not sure what I am doing wrong. Please help. Note that the boundary is a simple close polyline.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;bool AssociativeHatch(const AcDbObjectId&amp;amp; bdryId)
{
	AcDbHatch* pHatch = new AcDbHatch();
	pHatch-&amp;gt;setDatabaseDefaults();
	pHatch-&amp;gt;setAssociative(Adesk::kTrue);
	
	AcDbObjectIdArray boundaryIds;
	boundaryIds.append(bdryId);

	pHatch-&amp;gt;appendLoop(AcDbHatch::kExternal, boundaryIds);
	pHatch-&amp;gt;setPattern(AcDbHatch::kPreDefined, _T("_SOLID"));
	pHatch-&amp;gt;evaluateHatch();

	AcDbDatabase* pDb = acdbHostApplicationServices()-&amp;gt;workingDatabase();
	AcDbBlockTable* pBlockTable = NULL;
	AcDbBlockTableRecord* pMSpaceRecord = NULL;
	pDb-&amp;gt;getSymbolTable(pBlockTable, AcDb::kForRead);
	pBlockTable-&amp;gt;getAt(ACDB_MODEL_SPACE, pMSpaceRecord, AcDb::kForWrite);

	AcDbObjectId hatchId;
	pMSpaceRecord-&amp;gt;appendAcDbEntity(hatchId, pHatch);
	pMSpaceRecord-&amp;gt;close();

	pHatch-&amp;gt;close();
	return true;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 22:44:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/associative-hatch/m-p/13782380#M44109</guid>
      <dc:creator>karl.sch1983</dc:creator>
      <dc:date>2025-08-25T22:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Associative hatch</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/associative-hatch/m-p/13784750#M44113</link>
      <description>&lt;P&gt;AcDbHatch doc show to use addPersistentReactor&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2024/ENU/?guid=OARX-RefGuide-AcDbHatch" target="_blank"&gt;https://help.autodesk.com/view/OARX/2024/ENU/?guid=OARX-RefGuide-AcDbHatch&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;  static void createHatch(void)
  {
      auto ERR = [](Acad::ErrorStatus es)
          {
              if (es != Acad::eOk)
                  acutPrintf(_T("Error: %ls"), acadErrorStatusText(es));
          };

      ads_name ename;
      ads_point point;
      if (RTNORM != acedEntSel(_T("\nSelect rec: "), ename, point))
          return;

      AcDbObjectId objId;
      ERR(acdbGetObjectId(objId, ename));
      AcDbObjectIdArray dbObjIds;
      AcDbEntityPointer pEnt(objId);
      dbObjIds.append(pEnt-&amp;gt;objectId());
      AcDbBlockTableRecordPointer pBtr(ACDB_MODEL_SPACE, curDoc()-&amp;gt;database(), AcDb::kForWrite);
      ERR(pBtr.openStatus());
      AcDbObjectPointer&amp;lt;AcDbHatch&amp;gt; pHatch;
      ERR(pHatch.create());
      pHatch-&amp;gt;setDatabaseDefaults();
      ERR(pHatch-&amp;gt;setAssociative(Adesk::kTrue));
      ERR(pHatch-&amp;gt;setPattern(AcDbHatch::kPreDefined, _T("_SOLID")));
      ERR(pHatch-&amp;gt;setHatchStyle(AcDbHatch::kNormal));
      AcDbObjectId hatchId;
      ERR(pBtr-&amp;gt;appendAcDbEntity(hatchId, pHatch));
      ERR(pHatch-&amp;gt;appendLoop(AcDbHatch::kExternal, dbObjIds));
      ERR(pHatch-&amp;gt;evaluateHatch());
      ERR(pEnt-&amp;gt;upgradeOpen());
      ERR(pEnt-&amp;gt;addPersistentReactor(hatchId));
  }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Aug 2025 09:24:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/associative-hatch/m-p/13784750#M44113</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2025-08-27T09:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Associative hatch</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/associative-hatch/m-p/13789194#M44115</link>
      <description>&lt;P&gt;Thanks Daniel. That worked. I just wasn't sure if there was a different approach available other than the persistent reactor route. Thanks again.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 21:01:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/associative-hatch/m-p/13789194#M44115</guid>
      <dc:creator>karl.sch1983</dc:creator>
      <dc:date>2025-08-29T21:01:06Z</dc:date>
    </item>
  </channel>
</rss>

