<?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: How to remove ALL level lines (sublines) from an existing mesh element via C++ API? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-remove-ALL-level-lines-sublines-from-an-existing-mesh/m-p/706699#M10954</link>
    <description>&lt;P&gt;Ok, I found a simple solution: giving two sublines outside the mesh polygon will delete the sublines.&lt;/P&gt;</description>
    <pubDate>Sat, 27 Jun 2026 15:08:00 GMT</pubDate>
    <dc:creator>Mathias Jonathan</dc:creator>
    <dc:date>2026-06-27T15:08:00Z</dc:date>
    <item>
      <title>How to remove ALL level lines (sublines) from an existing mesh element via C++ API?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-remove-ALL-level-lines-sublines-from-an-existing-mesh/m-p/706598#M10949</link>
      <description>&lt;P&gt;I'm working on a Tapir command (open sourve addon) and need to enable the modify meshes command to be able to remove all level lines from an existing mesh element via ACAPI_Element_Change. Creating a mesh with no level lines works fine (null handles from BMAllocateHandle(0, ...) are correctly interpreted by ACAPI_Element_Create). But I cannot figure out how to clear them on an existing mesh.&lt;BR /&gt;&lt;STRONG&gt;Context:&lt;/STRONG&gt;&lt;BR /&gt;My GetDetailsOfElements reads level lines like this (following the official pattern):&lt;BR /&gt;if (elem.mesh.levelLines.nSubLines &amp;gt; 0) { ACAPI_Element_GetMemo(guid, &amp;amp;memo, APIMemoMask_MeshLevel); const GSSize nSublines = BMhGetSize(reinterpret_cast&amp;lt;GSHandle&amp;gt;(memo.meshLevelEnds)) / sizeof(Int32); // iterate sublines... }&lt;BR /&gt;So to get 0 sublines reported, I need either:&lt;BR /&gt;elem.mesh.levelLines.nSubLines == 0 stored in the element, or&lt;BR /&gt;BMhGetSize(memo.meshLevelEnds) &amp;lt; sizeof(Int32) after a successful change&lt;BR /&gt;&lt;STRONG&gt;Approaches I have tried — all result in the original 2 sublines being preserved:&lt;/STRONG&gt;&lt;BR /&gt;1/Null handles + APIMemoMask_MeshLevel: Kill both meshLevelEnds and meshLevelCoords handles (null), set elem.mesh.levelLines.nSubLines = 0, pass APIMemoMask_MeshLevel in memoChangeMask . &lt;EM&gt;ArchiCAD appears to ignore null handles and keeps existing data. Result: still 2 sublines.&lt;/EM&gt;&lt;BR /&gt;2/1-byte handle + APIMemoMask_MeshLevel: BMAllocateHandle(1, ALLOCATE_CLEAR, 0) for meshLevelEnds - &lt;EM&gt;BMhGetSize returns 8 (minimum physical allocation on 64-bit Windows) - 8 / sizeof(Int32) = 2. Still 2 sublines.&lt;/EM&gt;&lt;BR /&gt;3/BMhSetSize(h, 0) (= BMReallocHandle(h, 0, 0, 0)): Same minimum size problem&amp;nbsp; &lt;EM&gt;still 8 bytes 2 sublines.&lt;/EM&gt;&lt;BR /&gt;4/Element mask only (no APIMemoMask_MeshLevel): Set ACAPI_ELEMENT_MASK_SET(mask, API_MeshType, levelLines) with nSubLines = 0 but do NOT include APIMemoMask_MeshLevel in memoChangeMask&amp;nbsp; &lt;EM&gt;ArchiCAD does not update the stored nSubLines. Still 2 sublines.&lt;/EM&gt;&lt;BR /&gt;5/ACAPI_Element_ChangeMemo with null memo: After a successful ACAPI_Element_Change, call:&lt;BR /&gt;API_ElementMemo zeroMemo = {}; ACAPI_Element_ChangeMemo(elem.header.guid, APIMemoMask_MeshLevel, &amp;amp;zeroMemo); &lt;EM&gt;Also ignored, still 2 sublines.&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;BR /&gt;1-Is it even possible to remove all level lines from an existing mesh via the API?&lt;BR /&gt;2-If yes, what is the correct approach? Does ACAPI_Element_Change support clearing memo components via null handles, or is there another mechanism?&lt;BR /&gt;3-Is there a minimum valid state for meshLevelEnds that ArchiCAD will accept as "no level lines"?&lt;BR /&gt;4-Would ACAPI_Element_Delete + ACAPI_Element_Create (with the same geometry but no sublines) be the only workaround (losing the original GUID)?&lt;BR /&gt;Any guidance would be appreciated. Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2026 08:20:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-remove-ALL-level-lines-sublines-from-an-existing-mesh/m-p/706598#M10949</guid>
      <dc:creator>Mathias Jonathan</dc:creator>
      <dc:date>2026-06-26T08:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove ALL level lines (sublines) from an existing mesh element via C++ API?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-remove-ALL-level-lines-sublines-from-an-existing-mesh/m-p/706699#M10954</link>
      <description>&lt;P&gt;Ok, I found a simple solution: giving two sublines outside the mesh polygon will delete the sublines.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jun 2026 15:08:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-remove-ALL-level-lines-sublines-from-an-existing-mesh/m-p/706699#M10954</guid>
      <dc:creator>Mathias Jonathan</dc:creator>
      <dc:date>2026-06-27T15:08:00Z</dc:date>
    </item>
  </channel>
</rss>

