<?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 How to change the label text box position. in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-the-label-text-box-position/m-p/221348#M2230</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;In a custom add-on i tried to change the all label text box position. To do this task i used &lt;STRONG&gt;ACAPI_Element_GetElemList&lt;/STRONG&gt; to get all the Label text box guid. And after collect guids i accessed all related property of every individual Label text box using &lt;STRONG&gt;ACAPI_Element_Get&lt;/STRONG&gt;. And the i change the label.endC.x and label.endC.y position. But the problem is when i change them every label text box get inw new position but the size of that text box get small and the texts of that text box get delete accept the first letter of that text box text. &lt;BR /&gt;&lt;BR /&gt;Here i shared my current method to do this task.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;void	Do_Label_Edit(short NewPositionvalue)
{
	GSErrCode            err;
	GS::Array&amp;lt;API_Guid&amp;gt; LabelList;
	short check = 0;
	err = ACAPI_Element_GetElemList(API_LabelID, &amp;amp;LabelList);

	short totalLabels = LabelList.GetSize();
	// Get the layout Info


	for (GS::USize i = 0; i &amp;lt; LabelList.GetSize(); i++)
	{
		//Do
		//Change the level boxes position
		API_ElementMemo		memo;
		API_Element			element, mask;
		

		BNZeroMemory(&amp;amp;element, sizeof(API_Element));
		BNZeroMemory(&amp;amp;memo, sizeof(API_ElementMemo));

		element.header.guid = LabelList&lt;I&gt;; // First listed item index 
		element.header.typeID = API_LabelID;

		err = ACAPI_Element_Get(&amp;amp;element);
		if (err != NoError) {
			ErrorBeep("ACAPI_Element_Get", err);
			return;
		}


		
		ACAPI_ELEMENT_MASK_CLEAR(mask);
		ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, endC);

		if (element.label.labelClass == APILblClass_Text) {
			ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, u.text.loc);
			element.label.u.text.loc = { 10.5, 3.5 };
		}
		else if (element.label.labelClass == APILblClass_Symbol) {
			ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, u.symbol.pos);
			element.label.u.symbol.pos = { 10.5, 3.5 };
		}

		element.label.endC.x = 10.5;
		element.label.endC.y = 3.5;
		

		err = ACAPI_Element_GetMemo(element.header.guid, &amp;amp;memo);
		if (err != NoError) {
			ErrorBeep("ACAPI_Element_GetMemo", err);
			return;
		}

		
		err = ACAPI_CallUndoableCommand("crate new from last drawing", [&amp;amp;]()-&amp;gt;GSErrCode {
			err = ACAPI_Element_Change(&amp;amp;element, &amp;amp;mask, &amp;amp;memo, 0, true);
			return err;
		});
		if (err == NoError)
		{
			check++;
		}
		

		ACAPI_DisposeElemMemoHdls(&amp;amp;memo);

	}

	return; // Do_Label_Edit

}
&lt;/I&gt;&lt;/PRE&gt;
It will be helpful to me if i get any way to solve this problem.&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Sep 2021 07:21:46 GMT</pubDate>
    <dc:creator>Jahidur</dc:creator>
    <dc:date>2021-09-14T07:21:46Z</dc:date>
    <item>
      <title>How to change the label text box position.</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-the-label-text-box-position/m-p/221348#M2230</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;In a custom add-on i tried to change the all label text box position. To do this task i used &lt;STRONG&gt;ACAPI_Element_GetElemList&lt;/STRONG&gt; to get all the Label text box guid. And after collect guids i accessed all related property of every individual Label text box using &lt;STRONG&gt;ACAPI_Element_Get&lt;/STRONG&gt;. And the i change the label.endC.x and label.endC.y position. But the problem is when i change them every label text box get inw new position but the size of that text box get small and the texts of that text box get delete accept the first letter of that text box text. &lt;BR /&gt;&lt;BR /&gt;Here i shared my current method to do this task.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;void	Do_Label_Edit(short NewPositionvalue)
{
	GSErrCode            err;
	GS::Array&amp;lt;API_Guid&amp;gt; LabelList;
	short check = 0;
	err = ACAPI_Element_GetElemList(API_LabelID, &amp;amp;LabelList);

	short totalLabels = LabelList.GetSize();
	// Get the layout Info


	for (GS::USize i = 0; i &amp;lt; LabelList.GetSize(); i++)
	{
		//Do
		//Change the level boxes position
		API_ElementMemo		memo;
		API_Element			element, mask;
		

		BNZeroMemory(&amp;amp;element, sizeof(API_Element));
		BNZeroMemory(&amp;amp;memo, sizeof(API_ElementMemo));

		element.header.guid = LabelList&lt;I&gt;; // First listed item index 
		element.header.typeID = API_LabelID;

		err = ACAPI_Element_Get(&amp;amp;element);
		if (err != NoError) {
			ErrorBeep("ACAPI_Element_Get", err);
			return;
		}


		
		ACAPI_ELEMENT_MASK_CLEAR(mask);
		ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, endC);

		if (element.label.labelClass == APILblClass_Text) {
			ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, u.text.loc);
			element.label.u.text.loc = { 10.5, 3.5 };
		}
		else if (element.label.labelClass == APILblClass_Symbol) {
			ACAPI_ELEMENT_MASK_SET(mask, API_LabelType, u.symbol.pos);
			element.label.u.symbol.pos = { 10.5, 3.5 };
		}

		element.label.endC.x = 10.5;
		element.label.endC.y = 3.5;
		

		err = ACAPI_Element_GetMemo(element.header.guid, &amp;amp;memo);
		if (err != NoError) {
			ErrorBeep("ACAPI_Element_GetMemo", err);
			return;
		}

		
		err = ACAPI_CallUndoableCommand("crate new from last drawing", [&amp;amp;]()-&amp;gt;GSErrCode {
			err = ACAPI_Element_Change(&amp;amp;element, &amp;amp;mask, &amp;amp;memo, 0, true);
			return err;
		});
		if (err == NoError)
		{
			check++;
		}
		

		ACAPI_DisposeElemMemoHdls(&amp;amp;memo);

	}

	return; // Do_Label_Edit

}
&lt;/I&gt;&lt;/PRE&gt;
It will be helpful to me if i get any way to solve this problem.&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:21:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-the-label-text-box-position/m-p/221348#M2230</guid>
      <dc:creator>Jahidur</dc:creator>
      <dc:date>2021-09-14T07:21:46Z</dc:date>
    </item>
  </channel>
</rss>

