<?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: v27 How to set and turn off overrides for fills and surfaces (Not Graphic Overrides) in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572697#M8784</link>
    <description>&lt;P&gt;Awesome Bernd.. you've done it again.&lt;/P&gt;&lt;P&gt;I don't know how I missed this..&lt;/P&gt;&lt;P&gt;but also setting the mask helps &lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, once again mate.&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2023 13:59:58 GMT</pubDate>
    <dc:creator>Ben Cohen</dc:creator>
    <dc:date>2023-10-25T13:59:58Z</dc:date>
    <item>
      <title>v27 How to set and turn off overrides for fills and surfaces (Not Graphic Overrides)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572413#M8774</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am in the process of upgrading another addon to v27.. This one loops through a plan and sets the pens and surfaces to the companies standards..&amp;nbsp;&lt;/P&gt;&lt;P&gt;Back in v24, i could set an overridden cutfill fairly easily, say&lt;/P&gt;&lt;P&gt;element.slab.penOverride.cutFillBackgroupPen = 19;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;element.wall.refMat.attributeIndex = 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In version 27 this has changed and for the life of me I can't work it out..&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1. How do we set these override pens and surfaces in v27&lt;/P&gt;&lt;P&gt;Question 2. How to we set the override to off in v27&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the fill overrides I am talking about&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="BenCohen_0-1698134439381.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/47858i7E76A34C5792932D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BenCohen_0-1698134439381.png" alt="BenCohen_0-1698134439381.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are the surface overrides I am talking about&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BenCohen_1-1698134948051.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/47859iB99F9CA334F30EB6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BenCohen_1-1698134948051.png" alt="BenCohen_1-1698134948051.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciate .. TIA &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 11:21:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572413#M8774</guid>
      <dc:creator>Ben Cohen</dc:creator>
      <dc:date>2024-09-17T11:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: v27 How to set and turn off overrides for fills and surfaces (Not Graphic Overrides)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572558#M8777</link>
      <description>&lt;P&gt;Hi Ben,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The types behind these members changed to &lt;STRIKE&gt;&lt;STRONG&gt;GS::Optional&amp;lt;API_PenType&amp;gt;&lt;/STRONG&gt;&lt;/STRIKE&gt;&lt;STRONG&gt; APIOptional&amp;lt;API_PenType&amp;gt;&lt;/STRONG&gt; and &lt;STRIKE&gt;&lt;STRONG&gt;GS::Optional&amp;lt;API_AttributeIndex&amp;gt;&lt;/STRONG&gt;&lt;/STRIKE&gt;&lt;STRONG&gt; APIOptional&amp;lt;API_AttributeIndex&amp;gt;&lt;/STRONG&gt; behind the scenes. Also &lt;STRONG&gt;API_AttributeIndex&lt;/STRONG&gt; changed a bit.&lt;/P&gt;
&lt;P&gt;So to turn an override off I think you can just assign &lt;STRONG&gt;APINullValue&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;To set a value for the &lt;STRONG&gt;cutFillPen&lt;/STRONG&gt; you could use a cast and for &lt;STRONG&gt;refMat&lt;/STRONG&gt; use &lt;STRONG&gt;ACAPI_CreateAttributeIndex&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;// previous typo: elem.slab.cutFillBackgroundPen = APINULLGuid;
elem.slab.cutFillBackgroundPen = APINullValue;  // correct version to turn off
elem.slab.cutFillBackgroundPen = (API_PenIndex)19; // Set override pen to 19

elem.wall.refMat = APINullValue; // Turn off
elem.wall.refMat = ACAPI_CreateAttributeIndex (100);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;BR /&gt;Bernd&lt;BR /&gt;&lt;BR /&gt;Edit (2023-10-26): Fixed incorrect values/types as discussed below.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 06:55:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572558#M8777</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-10-26T06:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: v27 How to set and turn off overrides for fills and surfaces (Not Graphic Overrides)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572697#M8784</link>
      <description>&lt;P&gt;Awesome Bernd.. you've done it again.&lt;/P&gt;&lt;P&gt;I don't know how I missed this..&lt;/P&gt;&lt;P&gt;but also setting the mask helps &lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, once again mate.&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 13:59:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572697#M8784</guid>
      <dc:creator>Ben Cohen</dc:creator>
      <dc:date>2023-10-25T13:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: v27 How to set and turn off overrides for fills and surfaces (Not Graphic Overrides)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572782#M8792</link>
      <description>&lt;P&gt;Actually, the correct code is quite different. You can't use APINULLGuid .. because cutFillBackgroundPen is a pen index - not a GUID..&lt;/P&gt;&lt;P&gt;There is a new boolean parameter ".hasValue" just set this to false.&lt;/P&gt;&lt;P&gt;My problem was I hadn't changed the MASK_SET to these new parameters and therefore it wasn't working..&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;ACAPI_ELEMENT_MASK_SET(mask, API_SlabType, cutFillBackgroundPen);
ACAPI_ELEMENT_MASK_SET(mask, API_SlabType, cutFillPen);

if (element.slab.cutFillBackgroundPen.hasValue) {
	element.slab.cutFillBackgroundPen.hasValue = false;
	element.slab.cutFillPen.hasValue = false;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thanks for your help anyway Bernd &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 06:10:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572782#M8792</guid>
      <dc:creator>Ben Cohen</dc:creator>
      <dc:date>2023-10-26T06:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: v27 How to set and turn off overrides for fills and surfaces (Not Graphic Overrides)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572785#M8793</link>
      <description>&lt;P&gt;Yes &lt;STRONG&gt;APINULLGuid&lt;/STRONG&gt; was a typo sorry! It's still possible to use &lt;STRONG&gt;APINullValue&lt;/STRONG&gt; though. It should have the same effect as setting &lt;EM&gt;.hasValue = false&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;Here's the corresponding code for &lt;STRONG&gt;APIOptional&lt;/STRONG&gt; in AC27 headers:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void operator = (NullValueType nullOpt) {
    static_assert (nullOpt == APINullValue, "Unsafe assignment! Use APINullValue to indicate the loss of valid stored value.");
    hasValue = false;
}
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Also I've just realized that I've written &lt;STRONG&gt;GS::Optional&amp;lt;API_PenType&amp;gt;.&lt;/STRONG&gt; That's also wrong because it's&lt;STRONG&gt; APIOptional&amp;lt;API_PenType&amp;gt;&lt;/STRONG&gt;. Sorry for mixing it all up &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&amp;nbsp; I'll edit my answer above.&lt;BR /&gt;&lt;BR /&gt;And good catch with the mask!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 06:53:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/v27-How-to-set-and-turn-off-overrides-for-fills-and-surfaces-Not/m-p/572785#M8793</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-10-26T06:53:37Z</dc:date>
    </item>
  </channel>
</rss>

