<?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 Stair Creation in ArchiCAD 25 / CPP code in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Stair-Creation-in-ArchiCAD-25-CPP-code/m-p/575756#M8895</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I was trying to create a dog-legged stair with a mid-land after 10 steps in archiCad using CPP code.&lt;/P&gt;
&lt;P&gt;I was able to render the stair, but in the mid-land section a step was rendered. I have attached the screenshot of what I expected (right image) and what got rendered (left image).&lt;BR /&gt;&lt;BR /&gt;Like in ArchiCAD UI, Can we specify the stair flight and mid-landing positions in CPP api's?&lt;/P&gt;
&lt;P&gt;Below code was used&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NB: ArchiCAD Version 25&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;API_GetPolyType polyInfo = {};
    
    polyInfo.nCoords = 4;
    polyInfo.nArcs = 0;
    polyInfo.coords = (API_Coord**)BMhAllClear((polyInfo.nCoords + 1) * sizeof(API_Coord));
    (*polyInfo.coords)[1] = { convertFeetToM(0), convertFeetToM(0) };
    (*polyInfo.coords)[2] = { convertFeetToM(0), convertFeetToM(-12.3194) };
    (*polyInfo.coords)[3] = { convertFeetToM(-3.0020), convertFeetToM(-12.3194)};
    (*polyInfo.coords)[4] = { convertFeetToM(-3.0020), convertFeetToM(0) };

    
    API_Element element;
    API_ElementMemo memo;
    BNClear (element);
    BNClear (memo);

    element.header.typeID = API_StairID;
    err = ACAPI_Element_GetDefaults (&amp;amp;element, &amp;amp;memo);
//    element.stair.inputDirection = APISD_Upward;
    if (err != NoError) {
        ACAPI_WriteReport ("ACAPI_Element_GetDefaults (Stair) has failed with error code %ld!", true, err);
        ACAPI_DisposeElemMemoHdls (&amp;amp;memo);
        return err;
    }
    
    element.stair.totalHeight = convertFeetToM(height);
    element.stair.flightWidth = convertFeetToM(width);
    element.stair.riserHeight = convertFeetToM(riserHeight);
    element.stair.stepNum = steps;
    element.stair.baselinePosition = APILP_Center;
    memo.stairBaseLine.coords = polyInfo.coords;
    memo.stairBaseLine.parcs = polyInfo.parcs;
    memo.stairBaseLine.polygon.nCoords = polyInfo.nCoords;
    memo.stairBaseLine.polygon.nArcs = polyInfo.nArcs;

    err = ACAPI_Element_Create (&amp;amp;element, &amp;amp;memo);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stair rendering.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/49162i8AC145B4F213F1E1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Stair rendering.png" alt="Stair rendering.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:38:46 GMT</pubDate>
    <dc:creator>roni</dc:creator>
    <dc:date>2024-09-16T12:38:46Z</dc:date>
    <item>
      <title>Stair Creation in ArchiCAD 25 / CPP code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Stair-Creation-in-ArchiCAD-25-CPP-code/m-p/575756#M8895</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I was trying to create a dog-legged stair with a mid-land after 10 steps in archiCad using CPP code.&lt;/P&gt;
&lt;P&gt;I was able to render the stair, but in the mid-land section a step was rendered. I have attached the screenshot of what I expected (right image) and what got rendered (left image).&lt;BR /&gt;&lt;BR /&gt;Like in ArchiCAD UI, Can we specify the stair flight and mid-landing positions in CPP api's?&lt;/P&gt;
&lt;P&gt;Below code was used&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NB: ArchiCAD Version 25&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;API_GetPolyType polyInfo = {};
    
    polyInfo.nCoords = 4;
    polyInfo.nArcs = 0;
    polyInfo.coords = (API_Coord**)BMhAllClear((polyInfo.nCoords + 1) * sizeof(API_Coord));
    (*polyInfo.coords)[1] = { convertFeetToM(0), convertFeetToM(0) };
    (*polyInfo.coords)[2] = { convertFeetToM(0), convertFeetToM(-12.3194) };
    (*polyInfo.coords)[3] = { convertFeetToM(-3.0020), convertFeetToM(-12.3194)};
    (*polyInfo.coords)[4] = { convertFeetToM(-3.0020), convertFeetToM(0) };

    
    API_Element element;
    API_ElementMemo memo;
    BNClear (element);
    BNClear (memo);

    element.header.typeID = API_StairID;
    err = ACAPI_Element_GetDefaults (&amp;amp;element, &amp;amp;memo);
//    element.stair.inputDirection = APISD_Upward;
    if (err != NoError) {
        ACAPI_WriteReport ("ACAPI_Element_GetDefaults (Stair) has failed with error code %ld!", true, err);
        ACAPI_DisposeElemMemoHdls (&amp;amp;memo);
        return err;
    }
    
    element.stair.totalHeight = convertFeetToM(height);
    element.stair.flightWidth = convertFeetToM(width);
    element.stair.riserHeight = convertFeetToM(riserHeight);
    element.stair.stepNum = steps;
    element.stair.baselinePosition = APILP_Center;
    memo.stairBaseLine.coords = polyInfo.coords;
    memo.stairBaseLine.parcs = polyInfo.parcs;
    memo.stairBaseLine.polygon.nCoords = polyInfo.nCoords;
    memo.stairBaseLine.polygon.nArcs = polyInfo.nArcs;

    err = ACAPI_Element_Create (&amp;amp;element, &amp;amp;memo);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stair rendering.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/49162i8AC145B4F213F1E1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Stair rendering.png" alt="Stair rendering.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:38:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Stair-Creation-in-ArchiCAD-25-CPP-code/m-p/575756#M8895</guid>
      <dc:creator>roni</dc:creator>
      <dc:date>2024-09-16T12:38:46Z</dc:date>
    </item>
  </channel>
</rss>

