<?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 the index of library part does not work in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235612#M2858</link>
    <description>Are you attempting to change the element within an active undo session? Otherwise, what error is returned?</description>
    <pubDate>Fri, 10 Apr 2020 08:28:47 GMT</pubDate>
    <dc:creator>Ralph Wessel</dc:creator>
    <dc:date>2020-04-10T08:28:47Z</dc:date>
    <item>
      <title>changing the index of library part does not work</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235611#M2857</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I'm trying to change the library part index of an element by this code:&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;
API_Element elementMask;
BNZeroMemory(&amp;amp;elementMask, sizeof(API_Element));

ACAPI_ELEMENT_MASK_SET(elementMask, API_WindowType, openingBase.libInd);
element.window.openingBase.libInd = iLibIndex;

const GSErrCode error = ACAPI_Element_ChangeParameters({ element.header.guid }, &amp;amp;element, nullptr, &amp;amp;elementMask);

const GSErrCode errorChange = ACAPI_Element_Change(&amp;amp;element, &amp;amp;elementMask, nullptr, 0UL, false);

&lt;/PRE&gt;
But I get the result APIERR_BADPARS for both functions ACAPI_Element_ChangeParameters and ACAPI_Element_Change.&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2021 10:34:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235611#M2857</guid>
      <dc:creator>Martin Walter</dc:creator>
      <dc:date>2021-09-15T10:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: changing the index of library part does not work</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235612#M2858</link>
      <description>Are you attempting to change the element within an active undo session? Otherwise, what error is returned?</description>
      <pubDate>Fri, 10 Apr 2020 08:28:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235612#M2858</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2020-04-10T08:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: changing the index of library part does not work</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235613#M2859</link>
      <description>Yes I use the command in ACAPI_CallUndoableCommand.&lt;BR /&gt;
&lt;BR /&gt;
The returned error is APIERR_BADPARS.</description>
      <pubDate>Fri, 10 Apr 2020 13:02:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235613#M2859</guid>
      <dc:creator>Martin Walter</dc:creator>
      <dc:date>2020-04-10T13:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: changing the index of library part does not work</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235614#M2860</link>
      <description>Any ideas?</description>
      <pubDate>Sun, 19 Apr 2020 12:46:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235614#M2860</guid>
      <dc:creator>Martin Walter</dc:creator>
      <dc:date>2020-04-19T12:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: changing the index of library part does not work</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235615#M2861</link>
      <description>I think that changing just the index of the library part may not be sufficient. You probably also need to set the correct parameters for that object –&amp;nbsp;possibly that's what the error is indicating.&lt;BR /&gt;
&lt;BR /&gt;
You could get the correct parameters by loading the default from the object with &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;ACAPI_LibPart_GetParams&lt;E&gt;&lt;/E&gt;. The memo data retrieved with this method can be directly used to update the target element, but you might want to use &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;ACAPI_Element_Change&lt;E&gt;&lt;/E&gt; in order to write the changes to both the element and memo data.</description>
      <pubDate>Sun, 19 Apr 2020 17:57:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235615#M2861</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2020-04-19T17:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: changing the index of library part does not work</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235616#M2862</link>
      <description>Using the element memo instead of a nullptr was the correct hint. Thanks a lot!</description>
      <pubDate>Mon, 25 May 2020 14:30:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/changing-the-index-of-library-part-does-not-work/m-p/235616#M2862</guid>
      <dc:creator>Martin Walter</dc:creator>
      <dc:date>2020-05-25T14:30:58Z</dc:date>
    </item>
  </channel>
</rss>

