<?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: Delete Elevations get error! in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386838#M957</link>
    <description>&lt;P&gt;i never worked with the ACAPI_Database, but are you sure you dont need to put those API Calls not in a&amp;nbsp;ACAPI_CallUndoableCommand method?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: oops, did not see your post. sorry &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2023 14:49:11 GMT</pubDate>
    <dc:creator>Joel Buehler</dc:creator>
    <dc:date>2023-07-10T14:49:11Z</dc:date>
    <item>
      <title>Delete Elevations get error!</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386697#M951</link>
      <description>&lt;P&gt;I am try to delete Elevation element using below code but always get error saying "&lt;SPAN&gt;The command cannot be executed with the passed parameters.&lt;/SPAN&gt;" with error code&amp;nbsp;&lt;SPAN&gt;-2130312311.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;GS::Array&amp;lt;API_DatabaseUnId&amp;gt; dbases;
GSErrCode err = ACAPI_Database(APIDb_GetElevationDatabasesID, nullptr, &amp;amp;dbases);
if (err == NoError) {
for (const auto&amp;amp; dbUnId : dbases) {
API_DatabaseInfo dbPars = {};
BNZeroMemory(&amp;amp;dbPars, sizeof(API_DatabaseInfo));
dbPars.databaseUnId = dbUnId;
GSErrCode err2 = ACAPI_Database(APIDb_GetDatabaseInfoID, &amp;amp;dbPars, nullptr);
if (err2 == NoError &amp;amp;&amp;amp; dbPars.typeID == APIWind_ElevationID) {
GSErrCode err3 = ACAPI_Database(APIDb_DeleteDatabaseID, &amp;amp;dbPars, nullptr);
if (err3 != NoError) {
ACAPI_WriteReport("Remove Elevation Error &amp;gt;&amp;gt; %d", true, err3);
}
}
}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is there anyone could suggest how to fix?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 03:25:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386697#M951</guid>
      <dc:creator>Newbie</dc:creator>
      <dc:date>2023-07-12T03:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Elevations get error!</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386700#M952</link>
      <description>&lt;P&gt;Did you already try deleting the Elevation marker with &lt;STRONG&gt;ACAPI_Element_Delete&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;I've just tested it, and that works and also removes the elevation itself.&lt;BR /&gt;Don't forget to put it in an undo scope.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2023 07:15:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386700#M952</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-09T07:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Elevations get error!</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386709#M953</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A class="" href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/8527" target="_self"&gt;&lt;SPAN class=""&gt;bschwb&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your suggestion. Anyway, how to get&amp;nbsp;&lt;SPAN&gt;Elevation marker&amp;nbsp;list as per mentioned above?.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have try with&amp;nbsp;dbPars.databaseUnId.elemSetId from above code but still no luck.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2023 09:46:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386709#M953</guid>
      <dc:creator>Newbie</dc:creator>
      <dc:date>2023-07-09T09:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Elevations get error!</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386714#M954</link>
      <description>&lt;P&gt;You have to options to get the list of elevation markers:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use &lt;STRONG&gt;ACAPI_Element_GetElemList&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Use the &lt;STRONG&gt;linkedElement&lt;/STRONG&gt; of an Elevation Database&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Sample Codes&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Sample code for&lt;STRONG&gt; Option 1:&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;ACAPI_CallUndoableCommand ("Remove All Elevations 1", []() -&amp;gt; GSErrCode {
	GSErrCode err = NoError;

	GS::Array&amp;lt;API_Guid&amp;gt; elevationMarkers{};
	err = ACAPI_Element_GetElemList (API_ElevationID, &amp;amp;elevationMarkers);
	if (err != NoError) { return err; }

	err = ACAPI_Element_Delete (elevationMarkers);
	return err;
});&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Sample code for &lt;STRONG&gt;Option 2&lt;/STRONG&gt; (adapted from your previously posted code):&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;ACAPI_CallUndoableCommand ("Remove All Elevations 2", []() -&amp;gt; GSErrCode {
	GS::Array&amp;lt;API_DatabaseUnId&amp;gt; dbases;
	GSErrCode err = ACAPI_Database (APIDb_GetElevationDatabasesID, nullptr, &amp;amp;dbases);
	if (err == NoError) {
		for (const auto&amp;amp; dbUnId : dbases) {
			API_DatabaseInfo dbPars = {};
			BNZeroMemory (&amp;amp;dbPars, sizeof (API_DatabaseInfo));
			dbPars.databaseUnId = dbUnId;
			GSErrCode err2 = ACAPI_Database (APIDb_GetDatabaseInfoID, &amp;amp;dbPars, nullptr);
			if (err2 == NoError &amp;amp;&amp;amp; dbPars.typeID == APIWind_ElevationID) {
				GSErrCode err3 = ACAPI_Element_Delete ({ dbPars.linkedElement });
				if (err3 != NoError) {
					ACAPI_WriteReport ("Remove Elevation Error &amp;gt;&amp;gt; %d", true, err3);
				}
			}
		}
	}

	return NoError;
});
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Hope that helps,&lt;/P&gt;
&lt;P&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2023 10:15:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386714#M954</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-09T10:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Elevations get error!</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386755#M955</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Bernd,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot for your clearly suggestion. I will make a test on it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BTW, I am not sure whether it could be use with Sections part or not.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 03:13:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386755#M955</guid>
      <dc:creator>Newbie</dc:creator>
      <dc:date>2023-07-10T03:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Elevations get error!</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386763#M956</link>
      <description>&lt;P&gt;Both solutions also work for sections.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Option 1&lt;/STRONG&gt;: Use &lt;STRONG&gt;API_CutPlaneID&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Option 2: &lt;/STRONG&gt;Use &lt;STRONG&gt;APIDb_GetSectionDatabasesID&lt;/STRONG&gt; and &lt;STRONG&gt;APIWind_SectionID&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:34:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386763#M956</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-10T06:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Elevations get error!</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386838#M957</link>
      <description>&lt;P&gt;i never worked with the ACAPI_Database, but are you sure you dont need to put those API Calls not in a&amp;nbsp;ACAPI_CallUndoableCommand method?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: oops, did not see your post. sorry &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 14:49:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Delete-Elevations-get-error/m-p/386838#M957</guid>
      <dc:creator>Joel Buehler</dc:creator>
      <dc:date>2023-07-10T14:49:11Z</dc:date>
    </item>
  </channel>
</rss>

