<?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: Issues with rendering Objects through code(API_ObjectType) in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/585470#M9117</link>
    <description>&lt;P&gt;Hi Kency,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About 1 &amp;amp; 2: I think from the API point of placing an object, you have to specify &lt;STRONG&gt;pos&lt;/STRONG&gt; where you want the origin (0,0,0) of the GDL object to be.&lt;BR /&gt;My suspicion is, that &lt;STRONG&gt;offset &lt;/STRONG&gt;then might give you the distance of the clicked point to the actual position of the GDL origin as an output. That then depends on the &lt;STRONG&gt;fixPoint&lt;/STRONG&gt; if that's not at the GDL object's origin. I think &lt;STRONG&gt;offset&lt;/STRONG&gt; is not available as an input for API calls.&lt;BR /&gt;But all of this is just a guess how it works, I don't have time to confirm this right now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About 3: Is the difference only in the material display or is there something else I'm missing? Also what do you mean exactly by "rendered through code" vs. "rendered through ui"?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Bernd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2024 15:24:26 GMT</pubDate>
    <dc:creator>BerndSchwarzenbacher</dc:creator>
    <dc:date>2024-01-25T15:24:26Z</dc:date>
    <item>
      <title>Issues with rendering Objects through code(API_ObjectType)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/585270#M9113</link>
      <description>&lt;P&gt;Hey team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have been trying to render an object through Archicad Add-on code. Issues found:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Changing the fixPoint value does not change the object's position. We understand that the fix-point will be one of the several hotspots/points within the object that will be considered for the clicked position. However, when we change this value, it does not shift the object accordingly&lt;/LI&gt;
&lt;LI&gt;There is no change in rendering the object when the offset value is changed.&lt;/LI&gt;
&lt;LI&gt;There is a visual difference in the object when rendered through code and through the UI(Please refer to the screenshots)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Is there anything that we are missing out on?&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/8527"&gt;@BerndSchwarzenbacher&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7122"&gt;@Akos Somorjai&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;GSErrCode CreateFurnitureElement()
{
	API_Element element = {};
	BNClear(element);
	SetAPIElementType(element, API_ObjectID);
	API_ElementMemo memo{};
	BNClear(memo);

	GSErrCode err = ACAPI_Element_GetDefaults(&amp;amp;element, &amp;amp;memo);
	if (err != NoError)
	{
		return err;
	}
	element.object.head.floorInd = 0;
	Int32 libInd = GetLibraryIndex("Sofa L-Shape 03 26", APILib_ObjectID);
	if (libInd &amp;gt; 0)
	{
		element.object.libInd = libInd;
		element.object.pos = {2,2};
		element.object.angle = 0;
                element.object.level = 0;
                element.object.fixPoint = 1;
                element.object.useXYFixSize = false;
                element.object.offset = {1,1};
                element.object.xRatio = 1;
                element.object.yRatio =1;

		err = ACAPI_Element_Create(&amp;amp;element, &amp;amp;memo);
		if (err != NoError)
		{
			return err;
		}
		return NoError;
	}
	throw std::runtime_error("Furniture not found");
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Rendered through UI&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="renderedThroughUI.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/52386i0060E2374097358F/image-size/large?v=v2&amp;amp;px=999" role="button" title="renderedThroughUI.png" alt="renderedThroughUI.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rendered through code&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="renderedThroughCode.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/52387i82D076F84F2E8DD1/image-size/large?v=v2&amp;amp;px=999" role="button" title="renderedThroughCode.png" alt="renderedThroughCode.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;  &lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:58:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/585270#M9113</guid>
      <dc:creator>kency</dc:creator>
      <dc:date>2024-09-16T12:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with rendering Objects through code(API_ObjectType)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/585470#M9117</link>
      <description>&lt;P&gt;Hi Kency,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About 1 &amp;amp; 2: I think from the API point of placing an object, you have to specify &lt;STRONG&gt;pos&lt;/STRONG&gt; where you want the origin (0,0,0) of the GDL object to be.&lt;BR /&gt;My suspicion is, that &lt;STRONG&gt;offset &lt;/STRONG&gt;then might give you the distance of the clicked point to the actual position of the GDL origin as an output. That then depends on the &lt;STRONG&gt;fixPoint&lt;/STRONG&gt; if that's not at the GDL object's origin. I think &lt;STRONG&gt;offset&lt;/STRONG&gt; is not available as an input for API calls.&lt;BR /&gt;But all of this is just a guess how it works, I don't have time to confirm this right now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About 3: Is the difference only in the material display or is there something else I'm missing? Also what do you mean exactly by "rendered through code" vs. "rendered through ui"?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Bernd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 15:24:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/585470#M9117</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2024-01-25T15:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with rendering Objects through code(API_ObjectType)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/585876#M9136</link>
      <description>&lt;P&gt;1. For the &lt;STRONG&gt;fixPoint&lt;/STRONG&gt; what I meant was with the &lt;STRONG&gt;pos&lt;/STRONG&gt; value set to 0,0,0 and then just changing the fixPoint does not shift the object. Our understanding is that the &lt;STRONG&gt;position&lt;/STRONG&gt; will be aligned to the &lt;STRONG&gt;fixPoint&lt;/STRONG&gt; set. (For example, if the &lt;STRONG&gt;fixPoint&lt;/STRONG&gt; is one of the corners of the object, the &lt;STRONG&gt;pos&lt;/STRONG&gt; (0,0,0) will be set for that corner).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. &lt;STRONG&gt;Offset&lt;/STRONG&gt; is provided in the API documentation. But did not understand its relevance and it did not change the positioning of the object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. There is a visual difference. What I meant by "rendered through code" is the one on the left was placed by triggering the add-on that we have written(the snippet is shared in the first post) and "Rendered through UI" means we placed the exact same object through the archicad UI after the add-on execution.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 05:37:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/585876#M9136</guid>
      <dc:creator>kency</dc:creator>
      <dc:date>2024-01-30T05:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with rendering Objects through code(API_ObjectType)</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/634781#M9866</link>
      <description>&lt;P&gt;I've just seen that again and stilll have some thoughts, that's why I'm answering so late.&lt;BR /&gt;&lt;BR /&gt;1. I think that understanding is incorrect. I think the object is placed such that the GDL origin is at the specified position.&lt;BR /&gt;2. I think it's only an output parameter.&lt;/P&gt;
&lt;P&gt;3. Looking at the code, it seems like you are not updating the parameters in the memo after changing the library part index. So I guess, that the relevant material, surface and pen parameters are not properly set up for the object placed via the Add-On (since you get those parameters from the current default object).&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 09:45:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Issues-with-rendering-Objects-through-code-API-ObjectType/m-p/634781#M9866</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2024-10-08T09:45:52Z</dc:date>
    </item>
  </channel>
</rss>

