<?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: Change the default value of a parameter in a LibPart in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602234#M9320</link>
    <description>&lt;P&gt;Is the library part stored in a writable state? If not, e.g. embedded in an LCF, you won't be able to write changes to it&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2024 15:22:08 GMT</pubDate>
    <dc:creator>Ralph Wessel</dc:creator>
    <dc:date>2024-05-01T15:22:08Z</dc:date>
    <item>
      <title>Change the default value of a parameter in a LibPart</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602173#M9318</link>
      <description>&lt;P&gt;Hello experts,&lt;BR /&gt;I am a newbie and am here trying to get some information about changing the default value of a parameter in a LibPart. By reading &lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/APIAny-ChangeAParameterID/m-p/261329" target="_self"&gt;this topic&lt;/A&gt;, I have managed to call APIAny_OpenParametersID, APIAny_GetActParametersID, and APIAny_ChangeAParameterID on the parameter with NoError. But the parameter value does not change. Do I need to call some extra function after APIAny_ChangeAParameterID in order to "overwrite" the library part with the new default parameter value?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 09:05:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602173#M9318</guid>
      <dc:creator>tsuyoshimishina</dc:creator>
      <dc:date>2024-09-17T09:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Change the default value of a parameter in a LibPart</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602234#M9320</link>
      <description>&lt;P&gt;Is the library part stored in a writable state? If not, e.g. embedded in an LCF, you won't be able to write changes to it&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 15:22:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602234#M9320</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2024-05-01T15:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change the default value of a parameter in a LibPart</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602266#M9323</link>
      <description>&lt;P&gt;I'm not sure if it's in a writable state. The library part is in the embedded library folder. Do I need to call&amp;nbsp; ACAPI_Environment(APIEnv_OverwriteLibPartID) or some function to make it writable?&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 01:23:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602266#M9323</guid>
      <dc:creator>tsuyoshimishina</dc:creator>
      <dc:date>2024-05-02T01:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change the default value of a parameter in a LibPart</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602401#M9326</link>
      <description>&lt;P&gt;If it's in the embedded library, you should be able to echo the example code for ACAPI_LibraryPart_OpenParameters here:&amp;nbsp;&lt;A href="https://graphisoft.github.io/archicad-api-devkit/group___library_part.html" target="_blank"&gt;https://graphisoft.github.io/archicad-api-devkit/group___library_part.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 19:39:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602401#M9326</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2024-05-02T19:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change the default value of a parameter in a LibPart</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602486#M9328</link>
      <description>&lt;P&gt;Ralph,&lt;/P&gt;&lt;P&gt;Thank you for pointing me to an example.&lt;BR /&gt;Below is what I'm actually doing in my add-on to change the value of the "c4dPhoIESFile" parameter of a library part (lamp):&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;BNZeroMemory(&amp;amp;libPart, sizeof(API_LibPart));
// I have both parentUniID and ownUniID values of the library part in std::string variables
strcpy(libPart.ownUnID, ownUniID.c_str());
strcpy(libPart.parentUnID, parentUniID.c_str());
auto err = ACAPI_LibPart_Search(&amp;amp;libPart, false);
if (err != NoError)
    ACAPI_WriteReport(L("Failed to search the library part"), true);

API_GetParamsType theParams{ };
API_ParamOwnerType paramOwner{ };
paramOwner.typeID = API_ObjectID; // may have to be API_LampID?
paramOwner.libInd = libPart.index;
GSErrCode err = ACAPI_Goodies(APIAny_OpenParametersID, &amp;amp;paramOwner);
err |= ACAPI_Goodies(APIAny_GetActParametersID, &amp;amp;theParams);
if (err == NoError) {
    API_ChangeParamType changeParam{ };
    CHTruncate("c4dPhoIESFile", changeParam.name, API_NameLen);
    GS::UniString uniStrName("test.ies");
    GS::uchar_t uniStrBuffer[_MAX_FNAME]{ 0 };
    GS::ucsncpy(uniStrBuffer, uniStrName.ToUStr().Get(), _MAX_FNAME);
    changeParam.uStrValue = uniStrBuffer;
    err = ACAPI_Goodies(APIAny_ChangeAParameterID, &amp;amp;changeParam);
    if (err != NoError)
        ACAPI_WriteReport(L("[LampImportTest, ERROR] Failed to update the c4dPhoIESFile parameter"), true);
}
else ACAPI_WriteReport(L("[LampImportTest, ERROR] Failed to get the c4dPhoIESFile parameter"), true);
ACAPI_DisposeAddParHdl(&amp;amp;theParams.params);
ACAPI_Goodies(APIAny_CloseParametersID);&lt;/LI-CODE&gt;&lt;P&gt;This runs without any errors but the parameter value doesn't change.&lt;/P&gt;&lt;P&gt;I checked the parameter on GDL Object Editor, and noticed that its type is not a simple string but a list of selectable strings (which is called a "value list" in ARCHICAD terminology?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="c4dPhoIESFile.png" style="width: 855px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/60420iF4E337AD4C1C53ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="c4dPhoIESFile.png" alt="c4dPhoIESFile.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"test.ies" is certainly in the list, but it doesn't seem to be able to select it by simply setting a value to the parameter. Can you suggest me how to deal with this type of parameter using the API?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 11:06:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-the-default-value-of-a-parameter-in-a-LibPart/m-p/602486#M9328</guid>
      <dc:creator>tsuyoshimishina</dc:creator>
      <dc:date>2024-05-03T11:06:48Z</dc:date>
    </item>
  </channel>
</rss>

