<?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 AC26 API 'APIEnv_GetDocumentFrom3DSettingsID' is crashing in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/AC26-API-APIEnv-GetDocumentFrom3DSettingsID-is-crashing/m-p/394209#M1010</link>
    <description>&lt;P&gt;Hello, I've been experimenting on 3D Documents and I've encountered crashing when I use 'APIEnv_GetDocumentFrom3DSettingsID'. Then I checked and run the Database_Control example and it also crashes on that line ' GSErrCode err = ACAPI_Environment (APIEnv_GetDocumentFrom3DSettingsID, &amp;amp;dbPars.databaseUnId, &amp;amp;documentFrom3DType);'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;static void		Do_Change3DDocument ()
{
	API_DatabaseUnId	*dbases = nullptr;

	if (ACAPI_Database (APIDb_GetDocumentFrom3DDatabasesID, &amp;amp;dbases) == NoError) {
		GSSize nDbases = BMpGetSize (reinterpret_cast&amp;lt;GSPtr&amp;gt;(dbases)) / Sizeof32 (API_DatabaseUnId);

		if (nDbases &amp;gt; 0) {
			API_DatabaseInfo dbPars;
			API_DocumentFrom3DType documentFrom3DType;
			BNZeroMemory (&amp;amp;dbPars, sizeof (API_DatabaseInfo));
			dbPars.databaseUnId = dbases[0];

			GSErrCode err = ACAPI_Environment (APIEnv_GetDocumentFrom3DSettingsID, &amp;amp;dbPars.databaseUnId, &amp;amp;documentFrom3DType);
			if (err == NoError) {
				documentFrom3DType.attributeOptions.shouldUseUniformCutAttributes = !documentFrom3DType.attributeOptions.shouldUseUniformCutAttributes;
				err = ACAPI_Environment (APIEnv_ChangeDocumentFrom3DSettingsID, &amp;amp;dbPars.databaseUnId, &amp;amp;documentFrom3DType);
				if (err != NoError)
					DBPrintf ("APIEnv_ChangeDocumentFrom3DSettingsID returns with error code");
			} else {
				DBPrintf ("APIEnv_GetDocumentFrom3DSettingsID returns with error code");
			}

			BMKillHandle (reinterpret_cast&amp;lt;GSHandle*&amp;gt; (&amp;amp;documentFrom3DType.cutSetting.shapes));
		}
	}

	if (dbases != nullptr)
		BMpFree (reinterpret_cast&amp;lt;GSPtr&amp;gt;(dbases));
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the exception detected by Visual Studio&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Erenford_0-1691059392778.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/44283i77694CA24F29A721/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Erenford_0-1691059392778.png" alt="Erenford_0-1691059392778.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried running the AC25 addon and it works fine so this looks like a problem for AC26 API&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2023 10:37:00 GMT</pubDate>
    <dc:creator>Erenford</dc:creator>
    <dc:date>2023-08-03T10:37:00Z</dc:date>
    <item>
      <title>AC26 API 'APIEnv_GetDocumentFrom3DSettingsID' is crashing</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/AC26-API-APIEnv-GetDocumentFrom3DSettingsID-is-crashing/m-p/394209#M1010</link>
      <description>&lt;P&gt;Hello, I've been experimenting on 3D Documents and I've encountered crashing when I use 'APIEnv_GetDocumentFrom3DSettingsID'. Then I checked and run the Database_Control example and it also crashes on that line ' GSErrCode err = ACAPI_Environment (APIEnv_GetDocumentFrom3DSettingsID, &amp;amp;dbPars.databaseUnId, &amp;amp;documentFrom3DType);'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;static void		Do_Change3DDocument ()
{
	API_DatabaseUnId	*dbases = nullptr;

	if (ACAPI_Database (APIDb_GetDocumentFrom3DDatabasesID, &amp;amp;dbases) == NoError) {
		GSSize nDbases = BMpGetSize (reinterpret_cast&amp;lt;GSPtr&amp;gt;(dbases)) / Sizeof32 (API_DatabaseUnId);

		if (nDbases &amp;gt; 0) {
			API_DatabaseInfo dbPars;
			API_DocumentFrom3DType documentFrom3DType;
			BNZeroMemory (&amp;amp;dbPars, sizeof (API_DatabaseInfo));
			dbPars.databaseUnId = dbases[0];

			GSErrCode err = ACAPI_Environment (APIEnv_GetDocumentFrom3DSettingsID, &amp;amp;dbPars.databaseUnId, &amp;amp;documentFrom3DType);
			if (err == NoError) {
				documentFrom3DType.attributeOptions.shouldUseUniformCutAttributes = !documentFrom3DType.attributeOptions.shouldUseUniformCutAttributes;
				err = ACAPI_Environment (APIEnv_ChangeDocumentFrom3DSettingsID, &amp;amp;dbPars.databaseUnId, &amp;amp;documentFrom3DType);
				if (err != NoError)
					DBPrintf ("APIEnv_ChangeDocumentFrom3DSettingsID returns with error code");
			} else {
				DBPrintf ("APIEnv_GetDocumentFrom3DSettingsID returns with error code");
			}

			BMKillHandle (reinterpret_cast&amp;lt;GSHandle*&amp;gt; (&amp;amp;documentFrom3DType.cutSetting.shapes));
		}
	}

	if (dbases != nullptr)
		BMpFree (reinterpret_cast&amp;lt;GSPtr&amp;gt;(dbases));
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the exception detected by Visual Studio&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Erenford_0-1691059392778.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/44283i77694CA24F29A721/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Erenford_0-1691059392778.png" alt="Erenford_0-1691059392778.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried running the AC25 addon and it works fine so this looks like a problem for AC26 API&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 10:37:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/AC26-API-APIEnv-GetDocumentFrom3DSettingsID-is-crashing/m-p/394209#M1010</guid>
      <dc:creator>Erenford</dc:creator>
      <dc:date>2023-08-03T10:37:00Z</dc:date>
    </item>
  </channel>
</rss>

