<?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: ACAPI_Element_GetDefaults in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245647#M3021</link>
    <description>The function &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_GetDefaults&lt;E&gt;&lt;/E&gt; will really only look at the tool type and variation and extract the settings from the relevant tool. It won't take any notice of other data you inject, e.g. &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;element.object.libInd&lt;E&gt;&lt;/E&gt;.&lt;BR /&gt;
&lt;BR /&gt;
I think you probably want to retrieve the parameters of the target 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;. This will also retrieve other relevant pieces of data for the object settings, e.g. bounding size.</description>
    <pubDate>Mon, 05 Aug 2019 22:40:31 GMT</pubDate>
    <dc:creator>Ralph Wessel</dc:creator>
    <dc:date>2019-08-05T22:40:31Z</dc:date>
    <item>
      <title>ACAPI_Element_GetDefaults</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245646#M3020</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Dear developers!&lt;BR /&gt;&lt;BR /&gt;I have a simple addon which places library elements with different parameters. And i have a problem with getDefault parameters for the library items. I clear up the element and memo. Initialize element and then run Element_GetDefaults with these params. Then suddenly my element.object.libInd get something else and got a fully wrong memo as well. Where should i set my library element, to get the correct memo ? i have the correct toolboxitem, libraryIndex as well, which is used during initialization. For some item i also have the exact API_LibPart libPart if its needed.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;                //clear up the params.
		BNZeroMemory(&amp;amp;element, sizeof(API_Element));
		BNZeroMemory(&amp;amp;memo, sizeof(API_ElementMemo));

		//initialize element.header
		element.header.typeID = toolboxItem.typeID; //ElementTypeID
		element.header.variationID = toolboxItem.variationID; //VariationTypeID

                //initialize element.object
		element.object.libInd = libInd; //library index
		WriteReport("element.object.libInd", element.object.libInd);

		WriteReport("variationId", toolboxItem.variationID);

		//Get memo Defaults 
		err = ACAPI_Element_GetDefaults(&amp;amp;element, &amp;amp;memo);
		//element.object.libInd = libInd;
		WriteReport("element.object.libInd", element.object.libInd);
		WriteReport("variationId", toolboxItem.variationID);&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Sep 2022 08:19:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245646#M3020</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-29T08:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_Element_GetDefaults</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245647#M3021</link>
      <description>The function &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_GetDefaults&lt;E&gt;&lt;/E&gt; will really only look at the tool type and variation and extract the settings from the relevant tool. It won't take any notice of other data you inject, e.g. &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;element.object.libInd&lt;E&gt;&lt;/E&gt;.&lt;BR /&gt;
&lt;BR /&gt;
I think you probably want to retrieve the parameters of the target 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;. This will also retrieve other relevant pieces of data for the object settings, e.g. bounding size.</description>
      <pubDate>Mon, 05 Aug 2019 22:40:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245647#M3021</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2019-08-05T22:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_Element_GetDefaults</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245648#M3022</link>
      <description>Okay, thank you.&lt;BR /&gt;
&lt;BR /&gt;
So you say that the correct method to place a library part is that.&lt;BR /&gt;
&lt;BR /&gt;
-get the library part, index, toolbox, for example libPartSearch;&lt;BR /&gt;
-ACAPI_Element_GetDefaults(&amp;amp;element, &amp;amp;memo);&lt;BR /&gt;
- ACAPI_LibPart_GetParams(libInd, &amp;amp;a, &amp;amp;b, &amp;amp;parCount, &amp;amp;addPars); //get libpart Params which i already got, to pair the index of the params with names.&lt;BR /&gt;
- memo.params=addPars; // update memo params with the defaults&lt;BR /&gt;
-ACAPI_Element_Create(&amp;amp;element, &amp;amp;memo); //place the element&lt;BR /&gt;
- dispose memo and addPars&lt;BR /&gt;
- modify few of the params, with APIAny_OpenParametersID,APIAny_GetActParametersID,APIAny_ChangeAParameterID,APIAny_CloseParametersID,ACAPI_Element_Change&lt;BR /&gt;
&lt;BR /&gt;
Do you know something about mep elements? which parameters should be changed to get the  gs_connections working? Because i've modified (ConWidth_1,ConWidth_2,MEP_StraightLength,RotationAroundWAxis,RotationAroundZAxis,MEP_InsShow), and the connections not working, should i update manually the gs_connections array?</description>
      <pubDate>Tue, 06 Aug 2019 06:13:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245648#M3022</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-06T06:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_Element_GetDefaults</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245649#M3023</link>
      <description>Yes, that's essentially correct.&lt;BR /&gt;
&lt;BR /&gt;
Sorry, I don't have in-depth details about MEP object parameters.</description>
      <pubDate>Tue, 06 Aug 2019 09:06:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245649#M3023</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2019-08-06T09:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_Element_GetDefaults</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245650#M3024</link>
      <description>Dear Ralph!&lt;BR /&gt;
&lt;BR /&gt;
Sorry for the late reply, but i didn't have tim to test it in depth. but for now, i'm not able to place elements that way... I've got this error during element create. It looks good recognised my librarypart, which is valid and placebale. i couldn't find a clue where should i "register" ancestor, or why is it happening.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;APICreate_SL :: APIERR_BADPARS :: library part's ancestor is not registered ({F938E33A-329D-4A36-BE3E-85E126820996}-{8A51B735-58FB-4ECF-98B7-CCFDB21F2453})
APICreate_SL :: APIERR_BADPARS :: library part info (1400, "fénycsöves lámpa 22")
APICreate_SL :: APIERR_BADPARS :: library part is valid and placeable
&lt;/PRE&gt;

I've got these error during placing straight pipe, pipeBend and as you can see "fluorescent lamp" as well.  Several other elements like  Sprinkler,Dry Sprinkler and many self developed objects are placeable.</description>
      <pubDate>Tue, 13 Aug 2019 16:15:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245650#M3024</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-13T16:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_Element_GetDefaults</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245651#M3025</link>
      <description>Ok this was may bad... Because someway my typeID was wrong.  I set it manually API_LampID in this case and it worked, so i have to revisit how i got wrong toolboxitem.. for now it looks like i fixed it... &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
PS i found my mistake i tried to get toolboxitem before libpart search with only name of the part... I know it is not recommended to get parts by name but i can live with that.. Maybe later i'll change it to guid.</description>
      <pubDate>Thu, 15 Aug 2019 13:22:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-Element-GetDefaults/m-p/245651#M3025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-15T13:22:33Z</dc:date>
    </item>
  </channel>
</rss>

