<?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 Gsm object position issue with Archicad in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Gsm-object-position-issue-with-Archicad/m-p/580955#M9011</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi Team,&lt;BR /&gt;I am experiencing a problem with a Library Object that I have trying to render through code in Archicad.&amp;nbsp;&lt;BR /&gt;The midpoint of the object while saving it as a gsm is on the center point of the object.&lt;BR /&gt;While when i try to create this object to archichad using API, the global position of the object gets defined by the top right corner of the object. No matter the rotation and position, it is always this top left corner from the center point of the IFC structure.&amp;nbsp;&lt;BR /&gt;But if we Place this element through UI, The global position should always be the centre point of the object.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sijocherian_0-1702966344291.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50698i939088F5145E7F11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sijocherian_0-1702966344291.png" alt="sijocherian_0-1702966344291.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Is there any way to make the the rendering point in archicad from top right corner to the centre?&lt;BR /&gt;&lt;BR /&gt;Code:&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(int storey, const char* name, API_Coord pos, double angle)
{

	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 = short(storey);

	Int32 libInd = GetLibraryIndex(name, APILib_ObjectID);
	if (libInd &amp;gt; 0)
	{
		element.object.libInd = libInd;
		element.object.pos = pos;
		element.object.angle = angle;
		err = ACAPI_Element_Create(&amp;amp;element, &amp;amp;memo);
		if (err != NoError)
		{

			return err;
		}
	}
	return NoError;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 10:43:30 GMT</pubDate>
    <dc:creator>sijocherian</dc:creator>
    <dc:date>2024-09-17T10:43:30Z</dc:date>
    <item>
      <title>Gsm object position issue with Archicad</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Gsm-object-position-issue-with-Archicad/m-p/580955#M9011</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Team,&lt;BR /&gt;I am experiencing a problem with a Library Object that I have trying to render through code in Archicad.&amp;nbsp;&lt;BR /&gt;The midpoint of the object while saving it as a gsm is on the center point of the object.&lt;BR /&gt;While when i try to create this object to archichad using API, the global position of the object gets defined by the top right corner of the object. No matter the rotation and position, it is always this top left corner from the center point of the IFC structure.&amp;nbsp;&lt;BR /&gt;But if we Place this element through UI, The global position should always be the centre point of the object.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sijocherian_0-1702966344291.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/50698i939088F5145E7F11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sijocherian_0-1702966344291.png" alt="sijocherian_0-1702966344291.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Is there any way to make the the rendering point in archicad from top right corner to the centre?&lt;BR /&gt;&lt;BR /&gt;Code:&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(int storey, const char* name, API_Coord pos, double angle)
{

	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 = short(storey);

	Int32 libInd = GetLibraryIndex(name, APILib_ObjectID);
	if (libInd &amp;gt; 0)
	{
		element.object.libInd = libInd;
		element.object.pos = pos;
		element.object.angle = angle;
		err = ACAPI_Element_Create(&amp;amp;element, &amp;amp;memo);
		if (err != NoError)
		{

			return err;
		}
	}
	return NoError;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 10:43:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Gsm-object-position-issue-with-Archicad/m-p/580955#M9011</guid>
      <dc:creator>sijocherian</dc:creator>
      <dc:date>2024-09-17T10:43:30Z</dc:date>
    </item>
  </channel>
</rss>

