<?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: Create and change database to newly created db in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233493#M4967</link>
    <description>Works! Thanks Oleg.</description>
    <pubDate>Thu, 12 Nov 2015 12:35:07 GMT</pubDate>
    <dc:creator>Miha Nahtigal</dc:creator>
    <dc:date>2015-11-12T12:35:07Z</dc:date>
    <item>
      <title>Create and change database to newly created db</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233491#M4965</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;When I try to switch current database to newly created worksheet, I get APIERR_BADDATABASE (The command cannot be executed on the current database). The worksheet is sucessfully created but changing database fails. What am I doing wrong here??&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;	GSErrCode					err;    
	API_DatabaseInfo			dbInfo;

	BNZeroMemory (&amp;amp;dbInfo, sizeof (API_DatabaseInfo));

	dbInfo.typeID = APIWind_WorksheetID;
	CHANSI2Unicode ("Det 1", (GS::Int32)strlen("Det 1"), dbInfo.name, API_UniLongNameLen);
	CHANSI2Unicode ("D10", (GS::Int32)strlen("D10"), dbInfo.ref, API_UniLongNameLen);

	if (ACAPI_Database (APIDb_NewDatabaseID, &amp;amp;dbInfo, NULL) == NoError) {
		err = ACAPI_Database (APIDb_ChangeCurrentDatabaseID, &amp;amp;dbInfo, NULL);
	}
&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Jul 2023 12:48:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233491#M4965</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2023-07-13T12:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create and change database to newly created db</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233492#M4966</link>
      <description>You need to open the window this database after creation, before the database using.&lt;BR /&gt;
( I dont check it in last APIs, may be it changed ).&lt;BR /&gt;
&lt;BR /&gt;
ACAPI_Automate( APIDo_ChangeWindowID, &amp;amp;m_db, NULL );</description>
      <pubDate>Thu, 12 Nov 2015 11:19:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233492#M4966</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2015-11-12T11:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create and change database to newly created db</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233493#M4967</link>
      <description>Works! Thanks Oleg.</description>
      <pubDate>Thu, 12 Nov 2015 12:35:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233493#M4967</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2015-11-12T12:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create and change database to newly created db</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233494#M4968</link>
      <description>&lt;BLOCKQUOTE&gt;vuego wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;	CHANSI2Unicode ("Det 1", (GS::Int32)strlen("Det 1"), dbInfo.name, API_UniLongNameLen);
	CHANSI2Unicode ("D10", (GS::Int32)strlen("D10"), dbInfo.ref, API_UniLongNameLen);

&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;

This can be simplified to:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;	GS::ucscpy (dbInfo.name, L("Det 1"));
	GS::ucscpy (dbInfo.ref, L("D10"));
&lt;/PRE&gt;

Best, Ákos</description>
      <pubDate>Tue, 19 Jan 2016 09:44:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Create-and-change-database-to-newly-created-db/m-p/233494#M4968</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2016-01-19T09:44:56Z</dc:date>
    </item>
  </channel>
</rss>

