<?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 ACAPI_GraphicalOverride_CreateOverrideRule rejects special pen values 0 and -1 for fillBackgroundPen in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-GraphicalOverride-CreateOverrideRule-rejects-special-pen/m-p/706706#M10955</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;I am developing a Tapir add-on command that reads graphical override rules and allows creating new ones programmatically. While testing, I found an inconsistency between ACAPI_GraphicalOverride_GetOverrideRuleById and ACAPI_GraphicalOverride_CreateOverrideRule regarding the fillBackgroundPenOverride field.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;WHAT I FOUND&lt;/STRONG&gt;&lt;BR /&gt;When I call GetOverrideRuleById on rules that use special fill background options set from the ArchiCAD UI, the API correctly returns the following penIndex values in the fillBackgroundPenOverride field:&lt;BR /&gt;penIndex 0 for "Transparent" background&lt;BR /&gt;penIndex -1 for "Window Background(? Not sure of term in English)"&amp;nbsp;&lt;BR /&gt;However, when I try to call CreateOverrideRule using those exact same values, I get APIERR_BADPARS (-2130313112) for both penIndex 0 and penIndex -1.&lt;BR /&gt;Other values work fine:&lt;BR /&gt;penIndex 1 through 255 (normal pen palette): OK&lt;BR /&gt;penIndex 1001 (zone category color): OK&lt;BR /&gt;API_RGBColor (any color): OK&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;REPRODUCTION STEPS&lt;/STRONG&gt;&lt;BR /&gt;In ArchiCAD UI, create a graphical override rule with fillBackgroundPenOverride set to "Transparent" (pen 0) or "Window Background" (pen -1).&lt;BR /&gt;Read it back with ACAPI_GraphicalOverride_GetOverrideRuleById. The value is correctly returned.&lt;BR /&gt;Try to create a new rule using the same API_OverrideRuleStyle. CreateOverrideRule returns APIERR_BADPARS.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Minimal C++ reproduction:&lt;/STRONG&gt;&lt;BR /&gt;API_OverrideRuleGroup ruleGroup; ruleGroup.name = "Test Group"; ACAPI_GraphicalOverride_CreateOverrideRuleGroup(ruleGroup); API_OverrideRule rule; rule.name = "Test Rule"; rule.criterionXML = ""; rule.style.fillBackgroundPenOverride = static_cast&amp;lt;short&amp;gt;(0); // transparent -- FAILS // rule.style.fillBackgroundPenOverride = static_cast&amp;lt;short&amp;gt;(-1); // window bg -- FAILS // rule.style.fillBackgroundPenOverride = static_cast&amp;lt;short&amp;gt;(1); // normal pen -- OK GSErrCode err = ACAPI_GraphicalOverride_CreateOverrideRule(rule, ruleGroup.guid); // err == APIERR_BADPARS for penIndex 0 and -1&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;EXPECTED BEHAVIOR&lt;/STRONG&gt;&lt;BR /&gt;If GetOverrideRuleById returns penIndex 0 or penIndex -1 as valid values for fillBackgroundPenOverride, then CreateOverrideRule should also accept those same values. The round-trip (read a rule, create a copy of it) should work without any special-casing.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This was tested as part of the open-source Tapir add-on project.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you for looking into this.&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jun 2026 01:56:47 GMT</pubDate>
    <dc:creator>Mathias Jonathan</dc:creator>
    <dc:date>2026-06-28T01:56:47Z</dc:date>
    <item>
      <title>ACAPI_GraphicalOverride_CreateOverrideRule rejects special pen values 0 and -1 for fillBackgroundPen</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-GraphicalOverride-CreateOverrideRule-rejects-special-pen/m-p/706706#M10955</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I am developing a Tapir add-on command that reads graphical override rules and allows creating new ones programmatically. While testing, I found an inconsistency between ACAPI_GraphicalOverride_GetOverrideRuleById and ACAPI_GraphicalOverride_CreateOverrideRule regarding the fillBackgroundPenOverride field.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;WHAT I FOUND&lt;/STRONG&gt;&lt;BR /&gt;When I call GetOverrideRuleById on rules that use special fill background options set from the ArchiCAD UI, the API correctly returns the following penIndex values in the fillBackgroundPenOverride field:&lt;BR /&gt;penIndex 0 for "Transparent" background&lt;BR /&gt;penIndex -1 for "Window Background(? Not sure of term in English)"&amp;nbsp;&lt;BR /&gt;However, when I try to call CreateOverrideRule using those exact same values, I get APIERR_BADPARS (-2130313112) for both penIndex 0 and penIndex -1.&lt;BR /&gt;Other values work fine:&lt;BR /&gt;penIndex 1 through 255 (normal pen palette): OK&lt;BR /&gt;penIndex 1001 (zone category color): OK&lt;BR /&gt;API_RGBColor (any color): OK&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;REPRODUCTION STEPS&lt;/STRONG&gt;&lt;BR /&gt;In ArchiCAD UI, create a graphical override rule with fillBackgroundPenOverride set to "Transparent" (pen 0) or "Window Background" (pen -1).&lt;BR /&gt;Read it back with ACAPI_GraphicalOverride_GetOverrideRuleById. The value is correctly returned.&lt;BR /&gt;Try to create a new rule using the same API_OverrideRuleStyle. CreateOverrideRule returns APIERR_BADPARS.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Minimal C++ reproduction:&lt;/STRONG&gt;&lt;BR /&gt;API_OverrideRuleGroup ruleGroup; ruleGroup.name = "Test Group"; ACAPI_GraphicalOverride_CreateOverrideRuleGroup(ruleGroup); API_OverrideRule rule; rule.name = "Test Rule"; rule.criterionXML = ""; rule.style.fillBackgroundPenOverride = static_cast&amp;lt;short&amp;gt;(0); // transparent -- FAILS // rule.style.fillBackgroundPenOverride = static_cast&amp;lt;short&amp;gt;(-1); // window bg -- FAILS // rule.style.fillBackgroundPenOverride = static_cast&amp;lt;short&amp;gt;(1); // normal pen -- OK GSErrCode err = ACAPI_GraphicalOverride_CreateOverrideRule(rule, ruleGroup.guid); // err == APIERR_BADPARS for penIndex 0 and -1&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;EXPECTED BEHAVIOR&lt;/STRONG&gt;&lt;BR /&gt;If GetOverrideRuleById returns penIndex 0 or penIndex -1 as valid values for fillBackgroundPenOverride, then CreateOverrideRule should also accept those same values. The round-trip (read a rule, create a copy of it) should work without any special-casing.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This was tested as part of the open-source Tapir add-on project.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you for looking into this.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jun 2026 01:56:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-GraphicalOverride-CreateOverrideRule-rejects-special-pen/m-p/706706#M10955</guid>
      <dc:creator>Mathias Jonathan</dc:creator>
      <dc:date>2026-06-28T01:56:47Z</dc:date>
    </item>
  </channel>
</rss>

