<?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: Materials of Profile in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Materials-of-Profile/m-p/591855#M9248</link>
    <description>&lt;LI-CODE lang="cpp"&gt;//1. You need to get a list of beam segments
ACAPI_Element_GetMemo(element.header.guid, &amp;amp;memo, APIMemoMask_BeamSegment)
//2. Get the profile index for the segment, if the segment is made by a profile
if (structtype == API_ProfileStructure) constrinx = memo.beamSegments[0].assemblySegmentData.profileAttr
//3. Get the profile itself
UInt64 mask = APIMemoMask_StretchedProfile;
GSErrCode err = ACAPI_Element_GetMemo(elemhead.guid, &amp;amp;memo, mask);
ProfileVectorImage profileDescription = *memo.stretchedProfile;
//4. Go through the hatches in ProfileVectorImage and get the index of the materials

ConstProfileVectorImageIterator profileDescriptionIt(profileDescription);
while (!profileDescriptionIt.IsEOI()) {
    switch (profileDescriptionIt-&amp;gt;item_Typ) {
    case SyHatch:
    {
        const HatchObject&amp;amp; syHatch = profileDescriptionIt;
        Geometry::MultiPolygon2D result;
        if (syHatch.ToPolygon2D(result, HatchObject::VertexAndEdgeData::Omit) == NoError) {
            for (UInt32 i = 0; i &amp;lt; result.GetSize(); i++) {
                API_AttributeIndex	constrinxL = ACAPI_CreateAttributeIndex((GS::Int32)syHatch.GetBuildMatIdx().ToGSAttributeIndex());
            }
        }
    }
    break;
    }
    ++profileDescriptionIt1;
}&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 11 Mar 2024 14:16:58 GMT</pubDate>
    <dc:creator>kuvbur</dc:creator>
    <dc:date>2024-03-11T14:16:58Z</dc:date>
    <item>
      <title>Materials of Profile</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Materials-of-Profile/m-p/591843#M9247</link>
      <description>&lt;P&gt;How can I get the materials of a profile?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Profiles.jpg" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/54590i6C5E4E6989ED9E32/image-size/large?v=v2&amp;amp;px=999" role="button" title="Profiles.jpg" alt="Profiles.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I use complex profiles with columns and beams and want to get their materials but have no idea how to do that. Any suggestions or hints? Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 09:06:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Materials-of-Profile/m-p/591843#M9247</guid>
      <dc:creator>kolioi</dc:creator>
      <dc:date>2024-09-17T09:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Materials of Profile</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Materials-of-Profile/m-p/591855#M9248</link>
      <description>&lt;LI-CODE lang="cpp"&gt;//1. You need to get a list of beam segments
ACAPI_Element_GetMemo(element.header.guid, &amp;amp;memo, APIMemoMask_BeamSegment)
//2. Get the profile index for the segment, if the segment is made by a profile
if (structtype == API_ProfileStructure) constrinx = memo.beamSegments[0].assemblySegmentData.profileAttr
//3. Get the profile itself
UInt64 mask = APIMemoMask_StretchedProfile;
GSErrCode err = ACAPI_Element_GetMemo(elemhead.guid, &amp;amp;memo, mask);
ProfileVectorImage profileDescription = *memo.stretchedProfile;
//4. Go through the hatches in ProfileVectorImage and get the index of the materials

ConstProfileVectorImageIterator profileDescriptionIt(profileDescription);
while (!profileDescriptionIt.IsEOI()) {
    switch (profileDescriptionIt-&amp;gt;item_Typ) {
    case SyHatch:
    {
        const HatchObject&amp;amp; syHatch = profileDescriptionIt;
        Geometry::MultiPolygon2D result;
        if (syHatch.ToPolygon2D(result, HatchObject::VertexAndEdgeData::Omit) == NoError) {
            for (UInt32 i = 0; i &amp;lt; result.GetSize(); i++) {
                API_AttributeIndex	constrinxL = ACAPI_CreateAttributeIndex((GS::Int32)syHatch.GetBuildMatIdx().ToGSAttributeIndex());
            }
        }
    }
    break;
    }
    ++profileDescriptionIt1;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Mar 2024 14:16:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Materials-of-Profile/m-p/591855#M9248</guid>
      <dc:creator>kuvbur</dc:creator>
      <dc:date>2024-03-11T14:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Materials of Profile</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Materials-of-Profile/m-p/592032#M9249</link>
      <description>&lt;P&gt;Thanks a lot, that helped me.&lt;/P&gt;&lt;P&gt;I made it myself up to the 4th point but didn't know I have to use&amp;nbsp;VectorImage. And actually I used&amp;nbsp;ACAPI_Attribute_GetDefExt() not the memo.&amp;nbsp;Attribute_Test example has the correct code. Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 09:15:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Materials-of-Profile/m-p/592032#M9249</guid>
      <dc:creator>kolioi</dc:creator>
      <dc:date>2024-03-12T09:15:49Z</dc:date>
    </item>
  </channel>
</rss>

