<?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 API Calculate polyline length in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357371#M1159</link>
    <description>&lt;P&gt;Is there a simple way to fetch polyline length apart from looping through memo data, vertexes and arcs?&lt;/P&gt;&lt;P&gt;I couldn't find one... has anyone already been through this?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2022 18:04:29 GMT</pubDate>
    <dc:creator>Miha Nahtigal</dc:creator>
    <dc:date>2022-09-28T18:04:29Z</dc:date>
    <item>
      <title>API Calculate polyline length</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357371#M1159</link>
      <description>&lt;P&gt;Is there a simple way to fetch polyline length apart from looping through memo data, vertexes and arcs?&lt;/P&gt;&lt;P&gt;I couldn't find one... has anyone already been through this?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 18:04:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357371#M1159</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2022-09-28T18:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: API Calculate polyline length</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357423#M1160</link>
      <description>&lt;P&gt;I am guessing that you already tried the measure tool ? I am not as skilled with Archicad as some are but there must be a way to determine the length of a complicated polyline in creating a bill of quantities somehow ?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 02:39:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357423#M1160</guid>
      <dc:creator>mthd</dc:creator>
      <dc:date>2022-09-29T02:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: API Calculate polyline length</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357431#M1161</link>
      <description>&lt;P&gt;I am asking for C++ implementation inside an addon.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 05:23:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357431#M1161</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2022-09-29T05:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: API Calculate polyline length</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357438#M1162</link>
      <description>&lt;P&gt;Whoops ! I didn’t check the category first. That’s something I know nothing about lol. I hope you get a reply here from someone who knows. Have fun.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 06:31:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357438#M1162</guid>
      <dc:creator>mthd</dc:creator>
      <dc:date>2022-09-29T06:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: API Calculate polyline length</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357533#M1163</link>
      <description>&lt;P&gt;I'll answer to myself...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;// first point of memo.coords is dummy zeroes
for (short r = 2; r &amp;lt;= element.polyLine.poly.nCoords; r++) {
    segmentLength = sqrt(pow((*memo.coords)[r].x - (*memo.coords)[r - 1].x, 2) + pow((*memo.coords)[r].y - (*memo.coords)[r - 1].y, 2));
    arcIndex = FindArc(*memo.parcs, element.polyLine.poly.nArcs, r - 1);
    if (arcIndex &amp;gt;= 0) {
        // points with indexes r-1 and r are beginning and ending of an arc
        segmentLength = abs((*memo.parcs)[arcIndex].arcAngle) * segmentLength / 2 / sin(abs((*memo.parcs)[arcIndex].arcAngle)/2);
    }
    totalLength += segmentLength;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 29 Sep 2022 18:19:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/API-Calculate-polyline-length/m-p/357533#M1163</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2022-09-29T18:19:50Z</dc:date>
    </item>
  </channel>
</rss>

