<?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: How to close window? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279680#M3586</link>
    <description>See the Do_Close function of Automate_Functions example Add-On (Automate_Functions.cpp). It uses APIDo_CloseID to close the current active window.&lt;BR /&gt;
Please note, that this function is not for public usage (as you can read in the documentation of the function also).</description>
    <pubDate>Mon, 28 Jan 2019 09:32:16 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2019-01-28T09:32:16Z</dc:date>
    <item>
      <title>How to close window?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279679#M3585</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;GS::ErrCode err;&lt;BR /&gt;err = ACAPI_Automate(APIDo_CloseID,nullptr);&lt;BR /&gt;&lt;BR /&gt;As result I have - error code APIERR_REFUSEDCMD&lt;BR /&gt;&lt;BR /&gt;Help me please!)&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Oct 2022 14:42:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279679#M3585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-04T14:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to close window?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279680#M3586</link>
      <description>See the Do_Close function of Automate_Functions example Add-On (Automate_Functions.cpp). It uses APIDo_CloseID to close the current active window.&lt;BR /&gt;
Please note, that this function is not for public usage (as you can read in the documentation of the function also).</description>
      <pubDate>Mon, 28 Jan 2019 09:32:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279680#M3586</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2019-01-28T09:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to close window?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279681#M3587</link>
      <description>Sorry, it's not work.&lt;BR /&gt;
APIERR_REFUSEDCMD error.&lt;BR /&gt;
&lt;BR /&gt;
I need to calc change markers, that placed on the layout and in the it's drawins.&lt;BR /&gt;
To do this I'm in cicle:&lt;BR /&gt;
1. Opening drawing's view.&lt;BR /&gt;
2. Collecting change markers, that placed inside drawing's margins.&lt;BR /&gt;
3. And need to close opened view.&lt;BR /&gt;
&lt;BR /&gt;
p. 3 is not work.&lt;BR /&gt;
As result - many-many view windows still are opened after operation.</description>
      <pubDate>Mon, 28 Jan 2019 11:42:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279681#M3587</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-28T11:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to close window?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279682#M3588</link>
      <description>&lt;BLOCKQUOTE&gt;Tsepov wrote:&lt;BR /&gt;
Sorry, it's not work.&lt;BR /&gt;
APIERR_REFUSEDCMD error.
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
Use it exactly the same way as in Automate_Functions.cpp, so do not forget to pass the 1234 "magic number"  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_wink.gif" style="display : inline;" /&gt; 
&lt;PRE&gt;err = ACAPI_Automate (APIDo_CloseID, (void *) (Int32) 1234);&lt;/PRE&gt;

&lt;BR /&gt;
Another important note (copied from the documentation):
&lt;BLOCKQUOTE&gt;This function performs complete operations, so it cannot be called neither during undoable operations nor during non-undoable commands.&lt;/BLOCKQUOTE&gt;
That can be the other reason why you got that error message.</description>
      <pubDate>Mon, 28 Jan 2019 12:22:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279682#M3588</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2019-01-28T12:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to close window?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279683#M3589</link>
      <description>Is it possible to somehow switch to the database view of the drawing element?&lt;BR /&gt;
This is to read items from the View in the background without opening the View window.&lt;BR /&gt;
&lt;BR /&gt;
Now I have to use the API_DrawingLinkInfo linkGuid and&lt;BR /&gt;
ACAPI_Automate (APIDo_GoToViewID, const char * viewGuidStr); - it is he who opens a new view window, which is then impossible to close.</description>
      <pubDate>Mon, 28 Jan 2019 14:24:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279683#M3589</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-28T14:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to close window?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279684#M3590</link>
      <description>&lt;BLOCKQUOTE&gt;Tsepov wrote:&lt;BR /&gt;
Is it possible to somehow switch to the database view of the drawing element?&lt;BR /&gt;
This is to read items from the View in the background without opening the View window.&lt;BR /&gt;
&lt;BR /&gt;
Now I have to use the API_DrawingLinkInfo linkGuid and&lt;BR /&gt;
ACAPI_Automate (APIDo_GoToViewID, const char * viewGuidStr); - it is he who opens a new view window, which is then impossible to close.
&lt;/BLOCKQUOTE&gt;

Try
&lt;PRE&gt;ACAPI_Database(APIDb_ChangeCurrentDatabaseID, API_DatabaseInfo* databaseInfo);&lt;/PRE&gt;
although this requires the databaseUnId of the view instead of view guid, so you have to get the API_NavigatorItem first then use its databaseinfo (API_NavigatorItem::db).&lt;BR /&gt;

&lt;PRE&gt;ACAPI_Navigator(APINavigator_GetNavigatorItemID, const API_Guid* guid, API_NavigatorItem* navigatorItem);&lt;/PRE&gt;
Hope this works. Also don't forget to return to the original database afterwards or else the current window might get some weird responses</description>
      <pubDate>Fri, 01 Feb 2019 02:41:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279684#M3590</guid>
      <dc:creator>Erenford</dc:creator>
      <dc:date>2019-02-01T02:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to close window?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279685#M3591</link>
      <description>Thank you very much!!!!)))&lt;BR /&gt;
It works.&lt;BR /&gt;
You really helped me out!</description>
      <pubDate>Fri, 01 Feb 2019 17:49:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-close-window/m-p/279685#M3591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-01T17:49:36Z</dc:date>
    </item>
  </channel>
</rss>

