<?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: Hatch a region,appendLoop return eInvalidInput in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/hatch-a-region-appendloop-return-einvalidinput/m-p/12799380#M649</link>
    <description>&lt;P&gt;The region consists of two separate closed paths. I think&amp;nbsp;&lt;FONT face="courier new,courier"&gt;appendLoop(Adesk::Int32, const AcDbObjectIdArray&amp;amp;)&lt;/FONT&gt;&amp;nbsp;can only append exactly one loop each time. You could _EXPLODE the region to split it into two separate regions and create hatches in both of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to keep the region you can extract the bounding geometries and use the other appendLoop() methods:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;    Acad::ErrorStatus appendLoop(Adesk::Int32 loopType,
                                 const AcGeVoidPointerArray&amp;amp; edgePtrs,
                                 const AcGeIntArray&amp;amp;  edgeTypes);

    Acad::ErrorStatus appendLoop(Adesk::Int32 loopType,
                                 const AcGePoint2dArray&amp;amp; vertices,
                                 const AcGeDoubleArray&amp;amp; bulges);&lt;/LI-CODE&gt;
&lt;P&gt;But you won't be able to create an associative hatch like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only possible way to get associativity seems to be this&amp;nbsp;&lt;A title="acedConvertEntityToHatch()" href="https://help.autodesk.com/view/OARX/2024/ENU/?guid=OARX-RefGuide-acedConvertEntityToHatch_AcDbHatch__AcDbEntity___bool" target="_blank" rel="noopener"&gt;function in aced.h&lt;/A&gt;:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;Acad::ErrorStatus 
acedConvertEntityToHatch(AcDbHatch* pHatch, AcDbEntity*&amp;amp; pEnt, bool transferId);
&lt;/LI-CODE&gt;
&lt;P&gt;I never used this API and it seems to be tricky to handle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2024 07:04:59 GMT</pubDate>
    <dc:creator>tbrammer</dc:creator>
    <dc:date>2024-05-27T07:04:59Z</dc:date>
    <item>
      <title>Hatch a region,appendLoop return eInvalidInput</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/hatch-a-region-appendloop-return-einvalidinput/m-p/12797949#M648</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-05-26_102654.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1367420iCE3574346EA7C7A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-05-26_102654.png" alt="2024-05-26_102654.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV&gt;Acad::ErrorStatus es;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ads_name ename;ads_point pt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if(RTNORM==acedEntSel(_T("\nPlease select a region:"),ename,pt))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;acutPrintf(_T("\nError!"));return;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AcDbObjectId id;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;acdbGetObjectId(id,ename);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AcDbObjectIdArray objIds;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;objIds.append(id);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AcDbHatch *pHatch=new AcDbHatch();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AcGeVector3d normal(0,0,1);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;pHatch-&amp;gt;setNormal(normal);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;pHatch-&amp;gt;setElevation(0);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;pHatch-&amp;gt;setPattern(AcDbHatch::kPreDefined,_T("SOLID"));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;es=pHatch-&amp;gt;appendLoop(AcDbHatch::kExternal,objIds);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;assert(Acad::eInvalidInput== es);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;es=pHatch-&amp;gt;evaluateHatch();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;postToDb(db, pHatch);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have chosen a region and want to create a Hatch based on it, but appendLoop cannot return Acad:: eOk.Why?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/845950"&gt;@tbrammer&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 26 May 2024 02:47:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/hatch-a-region-appendloop-return-einvalidinput/m-p/12797949#M648</guid>
      <dc:creator>dziwve67853</dc:creator>
      <dc:date>2024-05-26T02:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch a region,appendLoop return eInvalidInput</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/hatch-a-region-appendloop-return-einvalidinput/m-p/12799380#M649</link>
      <description>&lt;P&gt;The region consists of two separate closed paths. I think&amp;nbsp;&lt;FONT face="courier new,courier"&gt;appendLoop(Adesk::Int32, const AcDbObjectIdArray&amp;amp;)&lt;/FONT&gt;&amp;nbsp;can only append exactly one loop each time. You could _EXPLODE the region to split it into two separate regions and create hatches in both of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to keep the region you can extract the bounding geometries and use the other appendLoop() methods:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;    Acad::ErrorStatus appendLoop(Adesk::Int32 loopType,
                                 const AcGeVoidPointerArray&amp;amp; edgePtrs,
                                 const AcGeIntArray&amp;amp;  edgeTypes);

    Acad::ErrorStatus appendLoop(Adesk::Int32 loopType,
                                 const AcGePoint2dArray&amp;amp; vertices,
                                 const AcGeDoubleArray&amp;amp; bulges);&lt;/LI-CODE&gt;
&lt;P&gt;But you won't be able to create an associative hatch like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only possible way to get associativity seems to be this&amp;nbsp;&lt;A title="acedConvertEntityToHatch()" href="https://help.autodesk.com/view/OARX/2024/ENU/?guid=OARX-RefGuide-acedConvertEntityToHatch_AcDbHatch__AcDbEntity___bool" target="_blank" rel="noopener"&gt;function in aced.h&lt;/A&gt;:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;Acad::ErrorStatus 
acedConvertEntityToHatch(AcDbHatch* pHatch, AcDbEntity*&amp;amp; pEnt, bool transferId);
&lt;/LI-CODE&gt;
&lt;P&gt;I never used this API and it seems to be tricky to handle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 07:04:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/hatch-a-region-appendloop-return-einvalidinput/m-p/12799380#M649</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2024-05-27T07:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Hatch a region,appendLoop return eInvalidInput</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/hatch-a-region-appendloop-return-einvalidinput/m-p/12801087#M650</link>
      <description>&lt;P&gt;acedCommand(RTSTR, TEXT("-HATCH"),RTSTR, _T("S"), RTENAME, regionName, RTSTR, _T(""), RTSTR, _T(""), RTNONE);&lt;/P&gt;&lt;P&gt;It is possible to convert a region to a Hatch using the lsp command. I am not sure how the lsp command is implemented internally.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 03:59:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/hatch-a-region-appendloop-return-einvalidinput/m-p/12801087#M650</guid>
      <dc:creator>dziwve67853</dc:creator>
      <dc:date>2024-05-28T03:59:06Z</dc:date>
    </item>
  </channel>
</rss>

