<?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 Hotlink via API was always created at the top most story and with offsets in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Hotlink-via-API-was-always-created-at-the-top-most-story-and/m-p/596324#M9270</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I followed/used the Element_Hotlink.cpp in API version 27 examples for creating hotlinks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;// -----------------------------------------------------------------------------
// Create a hotlink node and place hotlink element
// -----------------------------------------------------------------------------

GSErrCode	Do_CreateHotlink ()
{
	IO::Location sourceFileLoc;
	API_SpecFolderID specID = API_ApplicationFolderID;
	ACAPI_ProjectSettings_GetSpecFolder (&amp;amp;specID, &amp;amp;sourceFileLoc);
	sourceFileLoc.AppendToLocal (IO::Name ("Archicad Examples"));
	sourceFileLoc.AppendToLocal (IO::Name ("Residential House"));
	sourceFileLoc.AppendToLocal (IO::Name ("Residential House.pln"));

	API_Element element = {};
	element.header.type = API_HotlinkID;
	element.header.layer = APIApplicationLayerAttributeIndex;
	element.hotlink.type = APIHotlink_Module;

	element.hotlink.transformation = CreateTransformation ({10.0, 4.0, 0.0}, PI / 6.0);

	element.hotlink.ignoreTopFloorLinks	= true;
	element.hotlink.relinkWallOpenings	= false;
	element.hotlink.adjustLevelDiffs	= false;

	GSErrCode err = ACAPI_CallUndoableCommand ("Element Test - Create Hotlink Node and Place an Instance", [&amp;amp;] () -&amp;gt; GSErrCode {
		const GS::Optional&amp;lt;API_Guid&amp;gt; hotlinkNodeGuid = CreateHotlinkNode (sourceFileLoc);

		if (hotlinkNodeGuid.IsEmpty ()) {
			return APIERR_GENERAL;
		}

		element.hotlink.hotlinkNodeGuid = hotlinkNodeGuid.Get ();

		return ACAPI_Element_Create (&amp;amp;element, nullptr);
	});

	if (err == NoError) {
		ACAPI_WriteReport ("Hotlink instance is created successfully: {%T}", WriteToSessionReport,
							APIGuidToString (element.header.guid).ToPrintf ());
	} else {
		ACAPI_WriteReport ("Failed to Hotlink instance from: {%T}", WriteToSessionReport,
							sourceFileLoc.ToLogText ().ToPrintf ());
	}

	return err;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Though, I modified the transformation values to just have zero figures)&lt;BR /&gt;&lt;BR /&gt;My main concern is that, the newly created hotlink was always placed in my top most story. I was trying to create the hotlink in the ground floor (story index 0).&lt;BR /&gt;Aside from that, I'm not sure if it is possible to modify the Additional offset setting under elements settings via api?&lt;BR /&gt;I checked the Hotlink API type and it seems there is no existing parameter that correlates to that setting (correct me if im wrong)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kristkun_0-1711481354541.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/57902i7A17BB34AFC67F59/image-size/large?v=v2&amp;amp;px=999" role="button" title="kristkun_0-1711481354541.png" alt="kristkun_0-1711481354541.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:48:28 GMT</pubDate>
    <dc:creator>kristkun</dc:creator>
    <dc:date>2024-09-16T12:48:28Z</dc:date>
    <item>
      <title>Hotlink via API was always created at the top most story and with offsets</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Hotlink-via-API-was-always-created-at-the-top-most-story-and/m-p/596324#M9270</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I followed/used the Element_Hotlink.cpp in API version 27 examples for creating hotlinks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;// -----------------------------------------------------------------------------
// Create a hotlink node and place hotlink element
// -----------------------------------------------------------------------------

GSErrCode	Do_CreateHotlink ()
{
	IO::Location sourceFileLoc;
	API_SpecFolderID specID = API_ApplicationFolderID;
	ACAPI_ProjectSettings_GetSpecFolder (&amp;amp;specID, &amp;amp;sourceFileLoc);
	sourceFileLoc.AppendToLocal (IO::Name ("Archicad Examples"));
	sourceFileLoc.AppendToLocal (IO::Name ("Residential House"));
	sourceFileLoc.AppendToLocal (IO::Name ("Residential House.pln"));

	API_Element element = {};
	element.header.type = API_HotlinkID;
	element.header.layer = APIApplicationLayerAttributeIndex;
	element.hotlink.type = APIHotlink_Module;

	element.hotlink.transformation = CreateTransformation ({10.0, 4.0, 0.0}, PI / 6.0);

	element.hotlink.ignoreTopFloorLinks	= true;
	element.hotlink.relinkWallOpenings	= false;
	element.hotlink.adjustLevelDiffs	= false;

	GSErrCode err = ACAPI_CallUndoableCommand ("Element Test - Create Hotlink Node and Place an Instance", [&amp;amp;] () -&amp;gt; GSErrCode {
		const GS::Optional&amp;lt;API_Guid&amp;gt; hotlinkNodeGuid = CreateHotlinkNode (sourceFileLoc);

		if (hotlinkNodeGuid.IsEmpty ()) {
			return APIERR_GENERAL;
		}

		element.hotlink.hotlinkNodeGuid = hotlinkNodeGuid.Get ();

		return ACAPI_Element_Create (&amp;amp;element, nullptr);
	});

	if (err == NoError) {
		ACAPI_WriteReport ("Hotlink instance is created successfully: {%T}", WriteToSessionReport,
							APIGuidToString (element.header.guid).ToPrintf ());
	} else {
		ACAPI_WriteReport ("Failed to Hotlink instance from: {%T}", WriteToSessionReport,
							sourceFileLoc.ToLogText ().ToPrintf ());
	}

	return err;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Though, I modified the transformation values to just have zero figures)&lt;BR /&gt;&lt;BR /&gt;My main concern is that, the newly created hotlink was always placed in my top most story. I was trying to create the hotlink in the ground floor (story index 0).&lt;BR /&gt;Aside from that, I'm not sure if it is possible to modify the Additional offset setting under elements settings via api?&lt;BR /&gt;I checked the Hotlink API type and it seems there is no existing parameter that correlates to that setting (correct me if im wrong)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kristkun_0-1711481354541.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/57902i7A17BB34AFC67F59/image-size/large?v=v2&amp;amp;px=999" role="button" title="kristkun_0-1711481354541.png" alt="kristkun_0-1711481354541.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:48:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Hotlink-via-API-was-always-created-at-the-top-most-story-and/m-p/596324#M9270</guid>
      <dc:creator>kristkun</dc:creator>
      <dc:date>2024-09-16T12:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Hotlink via API was always created at the top most story and with offsets</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Hotlink-via-API-was-always-created-at-the-top-most-story-and/m-p/596382#M9271</link>
      <description>&lt;P&gt;Figured out that the created hotlink uses the floor setting in the mod file. When i tried creating another mod file with the elements in the ground floor, it was placed in the ground floor as well when created via api.&lt;BR /&gt;&lt;BR /&gt;However, what I need is to add existing hotlink module to any floor that i want via API.&lt;BR /&gt;When I checked the debug, when the hotlink (in 4th story) was created via ACAPI_Element_Create(), the story index of the element parameter was set to zero even though it was placed in the 4th story&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 03:44:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Hotlink-via-API-was-always-created-at-the-top-most-story-and/m-p/596382#M9271</guid>
      <dc:creator>kristkun</dc:creator>
      <dc:date>2024-03-27T03:44:45Z</dc:date>
    </item>
  </channel>
</rss>

