<?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: changing visible-state of a layer (before addon quits) in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107876#M6938</link>
    <description>Maybe you could just use a modeless dialog. Why does it have to be modal?</description>
    <pubDate>Fri, 13 Jan 2006 07:56:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-01-13T07:56:02Z</dc:date>
    <item>
      <title>changing visible-state of a layer (before addon quits)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107872#M6934</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I try to make a layer invisible from the modal dialog of my addon.&lt;BR /&gt;&lt;BR /&gt;Problem: The layer does not becomee invisible before the dialog is closed.&lt;BR /&gt;&lt;BR /&gt;I think this are the relevant lines of my code:&lt;BR /&gt;&lt;BR /&gt;mAcAttribute.layer.head.flags = APILay_Hidden;&lt;BR /&gt;GSErrCode err = ACAPI_Attribute_Modify(&amp;amp;mAcAttribute, NULL);&lt;BR /&gt;GSErrCode err = ACAPI_Database(APIDb_RedrawCurrentDatabaseID, NULL, NULL);&lt;BR /&gt;&lt;BR /&gt;I hope someone has a hint for me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Does "APIDb_RedrawCurrentDatabaseID" not cover layers?&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;John Mueller&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 09:32:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107872#M6934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-07T09:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: changing visible-state of a layer (before addon quits)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107873#M6935</link>
      <description>&amp;gt; Does "APIDb_RedrawCurrentDatabaseID" not cover layers? &lt;BR /&gt;
&lt;BR /&gt;
I found something:&lt;BR /&gt;
GSErrCode err = ACAPI_Automate(APIDo_RedrawID, NULL, NULL);&lt;BR /&gt;
&lt;BR /&gt;
now the handles of the selected elements painted in light grey instead of black when setting layer to be invisible.&lt;BR /&gt;
&lt;BR /&gt;
the elements do not become invisible befor the addon quits. &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
Has no one ever tried to switch the visible-state of a layer during the addon is running?</description>
      <pubDate>Thu, 12 Jan 2006 13:34:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107873#M6935</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-12T13:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: changing visible-state of a layer (before addon quits)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107874#M6936</link>
      <description>&lt;BLOCKQUOTE&gt;John wrote:&lt;BR /&gt;Hi &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
I try to make a layer invisible from the modal dialog of my addon.&lt;BR /&gt;
Problem: The layer does not becomee invisible before the dialog is closed.
&lt;/BLOCKQUOTE&gt;

John,&lt;BR /&gt;
&lt;BR /&gt;
I don't it is possible for changes like this to be displayed while a modal dialog box is active.&lt;BR /&gt;
&lt;BR /&gt;
It sounds to me as if you might be trying to work against ArchiCAD's UI principles. Can you roughly describe why you want to do this? There may be a better approach to the problem.&lt;BR /&gt;
&lt;BR /&gt;
Ralph.</description>
      <pubDate>Thu, 12 Jan 2006 23:11:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107874#M6936</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2006-01-12T23:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: changing visible-state of a layer (before addon quits)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107875#M6937</link>
      <description>Hi Ralph :-)
&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;John wrote:&lt;BR /&gt;Hi &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
I try to make a layer invisible from the modal dialog of my addon.&lt;BR /&gt;
Problem: The layer does not becomee invisible before the dialog is closed.
&lt;/BLOCKQUOTE&gt;
Can you roughly describe why you want to do this? There may be a better approach to the problem.
&lt;/BLOCKQUOTE&gt;

Sure:&lt;BR /&gt;
The Addon processes the selected lines, arcs and polylines and closes the gaps between the elements if the distance is below a defined threshold.&lt;BR /&gt;
A new polyline containing the elements is created.&lt;BR /&gt;
&lt;BR /&gt;
Example: &lt;BR /&gt;
line1 (0/0)(1.0001/0.9991)&lt;BR /&gt;
line2 (1/1.0001)(2/0)&lt;BR /&gt;
-&amp;gt;&lt;BR /&gt;
polyline (0/0)(1/1)(2/0)&lt;BR /&gt;
&lt;BR /&gt;
The original-elements are on layer A.&lt;BR /&gt;
The polyline is created on an layer B.&lt;BR /&gt;
&lt;BR /&gt;
I want to to toggle between:&lt;BR /&gt;
1. A visible / B invisible&lt;BR /&gt;
2. A invisible / B visible&lt;BR /&gt;
&lt;BR /&gt;
Elements the addon could not connect to a polyline because of ambiguity are to be moved to a problem-layer.&lt;BR /&gt;
Example: &lt;BR /&gt;
line1 (0/0)(1.0001/0.9991)&lt;BR /&gt;
line2 (1/1.0001)(2/0)&lt;BR /&gt;
line3 (0.0009/1.0001)(0/2)&lt;BR /&gt;
&lt;BR /&gt;
greetings,&lt;BR /&gt;
john</description>
      <pubDate>Fri, 13 Jan 2006 06:54:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107875#M6937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-13T06:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: changing visible-state of a layer (before addon quits)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107876#M6938</link>
      <description>Maybe you could just use a modeless dialog. Why does it have to be modal?</description>
      <pubDate>Fri, 13 Jan 2006 07:56:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107876#M6938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-13T07:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: changing visible-state of a layer (before addon quits)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107877#M6939</link>
      <description>&lt;BLOCKQUOTE&gt;adambutler wrote:&lt;BR /&gt;Maybe you could just use a modeless dialog. Why does it have to be modal?&lt;/BLOCKQUOTE&gt;

Oh, do you think it would work with a modless dialog? That would be great &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
I tried a modeless dialog, but it closed immediately, after I created it and the addon quits.&lt;BR /&gt;
Docu says: "DGModelessInit returns immediately as soon as the dialog is created."&lt;BR /&gt;
&lt;BR /&gt;
Hmm, do you have a hint how to keep the addon running?&lt;BR /&gt;
&lt;BR /&gt;
I am a rooky... Is there a way to code an idle-loop or what is the way you would handle this?&lt;BR /&gt;
&lt;BR /&gt;
I will browse the docu again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 13 Jan 2006 08:05:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107877#M6939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-13T08:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: changing visible-state of a layer (before addon quits)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107878#M6940</link>
      <description>&lt;BLOCKQUOTE&gt;John wrote:&lt;BR /&gt;
The Addon processes the selected lines, arcs and polylines and closes the gaps between the elements if the distance is below a defined threshold.&lt;BR /&gt;
A new polyline containing the elements is created.&lt;BR /&gt;
...&lt;BR /&gt;
The original-elements are on layer A.&lt;BR /&gt;
The polyline is created on an layer B.&lt;BR /&gt;
...&lt;BR /&gt;
I want to to toggle between:&lt;BR /&gt;
1. A visible / B invisible&lt;BR /&gt;
2. A invisible / B visible
&lt;/BLOCKQUOTE&gt;

John,&lt;BR /&gt;
&lt;BR /&gt;
The process you describe raises a lot of questions. I don't understand why you need a dialog for this at all - could it work in the following way:
&lt;UL&gt;&lt;LI&gt;1) The user selects the elements they want to join&lt;BR /&gt;
2) The user picks a menu item from your add-on&lt;BR /&gt;
3) The add-on joins the elements (if possible) and creates a new polyline element.&lt;BR /&gt;
4) The add-on deselects the original elements and creates a selection with the new polyline.&lt;/LI&gt;&lt;/UL&gt;

Layer toggling is well catered for in ArchiCAD with Layer sets, Views, and the contextual menu to Hide/Show Layers. Are you sure your add-on needs to do this?&lt;BR /&gt;
&lt;BR /&gt;
Also, the magic wand is pretty good at joining elements. Perhaps you are looking at larger tolerences than it works to?&lt;BR /&gt;
&lt;BR /&gt;
Ralph.</description>
      <pubDate>Fri, 13 Jan 2006 11:09:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-visible-state-of-a-layer-before-addon-quits/m-p/107878#M6940</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2006-01-13T11:09:00Z</dc:date>
    </item>
  </channel>
</rss>

