<?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 how do i create mesh hole? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/how-do-i-create-mesh-hole/m-p/107686#M6930</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;i know how to create hole in slab or roof..&lt;BR /&gt;but mesh is impossible.. why? is there a any solution or method to create mesh hole with API.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;i'm developing archicad 9...&lt;BR /&gt;&lt;BR /&gt;next line is sample code..&lt;BR /&gt;&lt;BR /&gt;static void Do_Poly_NewHole (void)&lt;BR /&gt;{&lt;BR /&gt;ACAPI_OpenUndoableSession ("Do_Poly_NewHole");&lt;BR /&gt;&lt;BR /&gt;API_GetPointType pointInfo;&lt;BR /&gt;API_GetPolyType polyInfo;&lt;BR /&gt;API_ElementMemo memo, insMemo;&lt;BR /&gt;API_RoofSide roofSide;&lt;BR /&gt;API_ElemTypeID typeID;&lt;BR /&gt;long iFrom, iTo, i, index;&lt;BR /&gt;GSErrCode err;&lt;BR /&gt;&lt;BR /&gt;// if (!ClickAnElem ("Click a polygon to insert a new hole into", API_ZombieElemID, &amp;amp;neig, &amp;amp;typeID, NULL, NULL)) {&lt;BR /&gt;if (!ClickAnElem ("Click a polygon to insert a new hole into", API_ZombieElemID, NULL, &amp;amp;typeID, &amp;amp;index, NULL)) {&lt;BR /&gt;WriteReport_Alert ("No element was clicked");&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if (typeID != API_SlabID &amp;amp;&amp;amp; typeID != API_RoofID &amp;amp;&amp;amp; typeID != API_MeshID) {&lt;BR /&gt;WriteReport_Alert ("Only slab or roof nodes/edges are excepted");&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;BNZeroMemory (&amp;amp;pointInfo, sizeof (API_GetPointType));&lt;BR /&gt;BNZeroMemory (&amp;amp;polyInfo, sizeof (API_GetPolyType));&lt;BR /&gt;strcpy (pointInfo.prompt, "Click the first node of the hole");&lt;BR /&gt;err = ACAPI_Interface (APIIo_GetPointID, &amp;amp;pointInfo, NULL);&lt;BR /&gt;if (err == NoError) {&lt;BR /&gt;strcpy (polyInfo.prompt, "Enter the polygon nodes");&lt;BR /&gt;polyInfo.startCoord = pointInfo.pos;&lt;BR /&gt;err = ACAPI_Interface (APIIo_GetPolyID, &amp;amp;polyInfo, NULL);&lt;BR /&gt;}&lt;BR /&gt;if (err != NoError) {&lt;BR /&gt;BMKillHandle ((GSHandle *) &amp;amp;polyInfo.coords);&lt;BR /&gt;BMKillHandle ((GSHandle *) &amp;amp;polyInfo.parcs);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;err = ACAPI_Element_GetMemo (typeID, index, &amp;amp;memo);&lt;BR /&gt;if (err != NoError) {&lt;BR /&gt;BMKillHandle ((GSHandle *) &amp;amp;polyInfo.coords);&lt;BR /&gt;BMKillHandle ((GSHandle *) &amp;amp;polyInfo.parcs);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;BNZeroMemory (&amp;amp;insMemo, sizeof (API_ElementMemo));&lt;BR /&gt;insMemo.coords = polyInfo.coords;&lt;BR /&gt;insMemo.parcs = polyInfo.parcs;&lt;BR /&gt;&lt;BR /&gt;polyInfo.coords = NULL;&lt;BR /&gt;polyInfo.parcs = NULL;&lt;BR /&gt;&lt;BR /&gt;err = ACAPI_Goodies (APIAny_InsertSubPolyID, &amp;amp;memo, &amp;amp;insMemo);&lt;BR /&gt;if (err == NoError) {&lt;BR /&gt;switch (typeID) {&lt;BR /&gt;case API_MeshID:&lt;BR /&gt;break;&lt;BR /&gt;case API_SlabID:&lt;BR /&gt;break; // nothing to do&lt;BR /&gt;case API_RoofID:&lt;BR /&gt;if (memo.roofSides != NULL &amp;amp;&amp;amp; *memo.roofSides != NULL) {&lt;BR /&gt;BNZeroMemory (&amp;amp;roofSide, sizeof (roofSide));&lt;BR /&gt;iFrom = BMGetHandleSize ((GSHandle) memo.roofSides) / sizeof (API_RoofSide) + 1;&lt;BR /&gt;iTo = BMGetHandleSize ((GSHandle) memo.coords) / sizeof (API_Coord);&lt;BR /&gt;for (i = iFrom; i &amp;lt;= iTo; i++)&lt;BR /&gt;InsertStructToHandle ((GSHandle) memo.roofSides, i - 1, (GSPtr) &amp;amp;roofSide, sizeof (roofSide));&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;&lt;BR /&gt;default:&lt;BR /&gt;ACAPI_DisposeElemMemoHdls (&amp;amp;insMemo);&lt;BR /&gt;ACAPI_DisposeElemMemoHdls (&amp;amp;memo);&lt;BR /&gt;return; // should never get here&lt;BR /&gt;}&lt;BR /&gt;err = ACAPI_Element_ChangeMemo (typeID, &amp;amp;index, APIMemoMask_Polygon, &amp;amp;memo);&lt;BR /&gt;if (err != NoError)&lt;BR /&gt;ShowMessageBox ("ACAPI_Element_ChangeMemo : %d", err);&lt;BR /&gt;} else&lt;BR /&gt;ShowMessageBox ("APIAny_InsertSubPolyID : %d", err);&lt;BR /&gt;&lt;BR /&gt;ACAPI_DisposeElemMemoHdls (&amp;amp;insMemo);&lt;BR /&gt;ACAPI_DisposeElemMemoHdls (&amp;amp;memo);&lt;BR /&gt;&lt;BR /&gt;ACAPI_CloseUndoableSession ();&lt;BR /&gt;return;&lt;BR /&gt;} // Do_Poly_NewHole&lt;/DIV&gt;</description>
    <pubDate>Mon, 07 Aug 2023 09:32:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-07T09:32:22Z</dc:date>
    <item>
      <title>how do i create mesh hole?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-do-i-create-mesh-hole/m-p/107686#M6930</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;i know how to create hole in slab or roof..&lt;BR /&gt;but mesh is impossible.. why? is there a any solution or method to create mesh hole with API.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;i'm developing archicad 9...&lt;BR /&gt;&lt;BR /&gt;next line is sample code..&lt;BR /&gt;&lt;BR /&gt;static void Do_Poly_NewHole (void)&lt;BR /&gt;{&lt;BR /&gt;ACAPI_OpenUndoableSession ("Do_Poly_NewHole");&lt;BR /&gt;&lt;BR /&gt;API_GetPointType pointInfo;&lt;BR /&gt;API_GetPolyType polyInfo;&lt;BR /&gt;API_ElementMemo memo, insMemo;&lt;BR /&gt;API_RoofSide roofSide;&lt;BR /&gt;API_ElemTypeID typeID;&lt;BR /&gt;long iFrom, iTo, i, index;&lt;BR /&gt;GSErrCode err;&lt;BR /&gt;&lt;BR /&gt;// if (!ClickAnElem ("Click a polygon to insert a new hole into", API_ZombieElemID, &amp;amp;neig, &amp;amp;typeID, NULL, NULL)) {&lt;BR /&gt;if (!ClickAnElem ("Click a polygon to insert a new hole into", API_ZombieElemID, NULL, &amp;amp;typeID, &amp;amp;index, NULL)) {&lt;BR /&gt;WriteReport_Alert ("No element was clicked");&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if (typeID != API_SlabID &amp;amp;&amp;amp; typeID != API_RoofID &amp;amp;&amp;amp; typeID != API_MeshID) {&lt;BR /&gt;WriteReport_Alert ("Only slab or roof nodes/edges are excepted");&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;BNZeroMemory (&amp;amp;pointInfo, sizeof (API_GetPointType));&lt;BR /&gt;BNZeroMemory (&amp;amp;polyInfo, sizeof (API_GetPolyType));&lt;BR /&gt;strcpy (pointInfo.prompt, "Click the first node of the hole");&lt;BR /&gt;err = ACAPI_Interface (APIIo_GetPointID, &amp;amp;pointInfo, NULL);&lt;BR /&gt;if (err == NoError) {&lt;BR /&gt;strcpy (polyInfo.prompt, "Enter the polygon nodes");&lt;BR /&gt;polyInfo.startCoord = pointInfo.pos;&lt;BR /&gt;err = ACAPI_Interface (APIIo_GetPolyID, &amp;amp;polyInfo, NULL);&lt;BR /&gt;}&lt;BR /&gt;if (err != NoError) {&lt;BR /&gt;BMKillHandle ((GSHandle *) &amp;amp;polyInfo.coords);&lt;BR /&gt;BMKillHandle ((GSHandle *) &amp;amp;polyInfo.parcs);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;err = ACAPI_Element_GetMemo (typeID, index, &amp;amp;memo);&lt;BR /&gt;if (err != NoError) {&lt;BR /&gt;BMKillHandle ((GSHandle *) &amp;amp;polyInfo.coords);&lt;BR /&gt;BMKillHandle ((GSHandle *) &amp;amp;polyInfo.parcs);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;BNZeroMemory (&amp;amp;insMemo, sizeof (API_ElementMemo));&lt;BR /&gt;insMemo.coords = polyInfo.coords;&lt;BR /&gt;insMemo.parcs = polyInfo.parcs;&lt;BR /&gt;&lt;BR /&gt;polyInfo.coords = NULL;&lt;BR /&gt;polyInfo.parcs = NULL;&lt;BR /&gt;&lt;BR /&gt;err = ACAPI_Goodies (APIAny_InsertSubPolyID, &amp;amp;memo, &amp;amp;insMemo);&lt;BR /&gt;if (err == NoError) {&lt;BR /&gt;switch (typeID) {&lt;BR /&gt;case API_MeshID:&lt;BR /&gt;break;&lt;BR /&gt;case API_SlabID:&lt;BR /&gt;break; // nothing to do&lt;BR /&gt;case API_RoofID:&lt;BR /&gt;if (memo.roofSides != NULL &amp;amp;&amp;amp; *memo.roofSides != NULL) {&lt;BR /&gt;BNZeroMemory (&amp;amp;roofSide, sizeof (roofSide));&lt;BR /&gt;iFrom = BMGetHandleSize ((GSHandle) memo.roofSides) / sizeof (API_RoofSide) + 1;&lt;BR /&gt;iTo = BMGetHandleSize ((GSHandle) memo.coords) / sizeof (API_Coord);&lt;BR /&gt;for (i = iFrom; i &amp;lt;= iTo; i++)&lt;BR /&gt;InsertStructToHandle ((GSHandle) memo.roofSides, i - 1, (GSPtr) &amp;amp;roofSide, sizeof (roofSide));&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;&lt;BR /&gt;default:&lt;BR /&gt;ACAPI_DisposeElemMemoHdls (&amp;amp;insMemo);&lt;BR /&gt;ACAPI_DisposeElemMemoHdls (&amp;amp;memo);&lt;BR /&gt;return; // should never get here&lt;BR /&gt;}&lt;BR /&gt;err = ACAPI_Element_ChangeMemo (typeID, &amp;amp;index, APIMemoMask_Polygon, &amp;amp;memo);&lt;BR /&gt;if (err != NoError)&lt;BR /&gt;ShowMessageBox ("ACAPI_Element_ChangeMemo : %d", err);&lt;BR /&gt;} else&lt;BR /&gt;ShowMessageBox ("APIAny_InsertSubPolyID : %d", err);&lt;BR /&gt;&lt;BR /&gt;ACAPI_DisposeElemMemoHdls (&amp;amp;insMemo);&lt;BR /&gt;ACAPI_DisposeElemMemoHdls (&amp;amp;memo);&lt;BR /&gt;&lt;BR /&gt;ACAPI_CloseUndoableSession ();&lt;BR /&gt;return;&lt;BR /&gt;} // Do_Poly_NewHole&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 09:32:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-do-i-create-mesh-hole/m-p/107686#M6930</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-07T09:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create mesh hole?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-do-i-create-mesh-hole/m-p/107687#M6931</link>
      <description>&lt;BLOCKQUOTE&gt;futurewave wrote:&lt;BR /&gt;i know how to create hole in slab or roof..&lt;BR /&gt;
but mesh is impossible.. why? is there a any solution or method to create mesh hole with API.&lt;/BLOCKQUOTE&gt;

I haven't checked to confirm this, but off the top of my head it seems the problem is that you aren't populating the 'meshPolyZ' information for the new hole in the mesh. This contains the z coordinates of the hole vertices.</description>
      <pubDate>Wed, 11 Jan 2006 12:28:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-do-i-create-mesh-hole/m-p/107687#M6931</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2006-01-11T12:28:38Z</dc:date>
    </item>
  </channel>
</rss>

