<?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: Moving Dimension text thru API disables 'Always Readable'? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275744#M3561</link>
    <description>Yes, it is indeed a bug. I made an entry for it. Let me know if this is a great deal for the project, and we will do our best to fix it.</description>
    <pubDate>Mon, 04 Feb 2019 16:37:59 GMT</pubDate>
    <dc:creator>sznagy</dc:creator>
    <dc:date>2019-02-04T16:37:59Z</dc:date>
    <item>
      <title>Moving Dimension text thru API disables 'Always Readable'?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275741#M3558</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello everyone,&lt;BR /&gt;What I'm trying to do is to move the dimension text (force it to the center) if its automatic position is outside. I've successfully done it, but I noticed that when I move it thru API, 'Always Readable' is disabled. I tried moving the text manually on Archicad and it didn't change it.&lt;BR /&gt;&lt;BR /&gt;I've also tried setting it to true whenever I change element, but it turns out it doesn't have an equivalent variable in the 'API_NoteType' struct (or I kind of missed it).&lt;BR /&gt;&lt;BR /&gt;I've tried this on Dimensions, Radial Dimension, and Hatches, elements using API_NoteType.&lt;BR /&gt;&lt;BR /&gt;The only changes I do on the element memo is:&lt;BR /&gt;memo.dimElems[].note.pos = [center]&lt;BR /&gt;memo.dimElems[].note.fixPos = true&lt;BR /&gt;&lt;BR /&gt;Below is a copy of my code:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;GSErrCode Dimension_MoveTextToCenter(API_Guid&amp;amp; i_guid)
{
	API_ElementMemo memo;
	BNZeroMemory(&amp;amp;memo, sizeof(memo));
	GSErrCode err = ACAPI_Element_GetMemo(i_guid, &amp;amp;memo, APIMemoMask_AdditionalPolygon);
	if (err != NoError)
		DBGPrintlnf("[" __FUNC__ "] ERROR %s - ACAPI_Element_GetMemo(APIMemoMask_AdditionalPolygon)", ErrId2Name(err));
	else
	{
		bool hasChanges = false;
		const UInt32 nDimElem = BMGetHandleSize((GSHandle)memo.dimElems) / sizeof(API_DimElem);
		for (UInt32 d = 1; d &amp;lt; nDimElem; ++d)
		{
			auto&amp;amp; dimElem = (*memo.dimElems);
			if (dimElem.dimVal == 0) continue;
			auto&amp;amp; dimElemPrev = (*memo.dimElems)[d - 1];

			if (!Dimension_MoveTextToCenter(dimElem.note, dimElem.pos, dimElemPrev.pos))
				continue;

			double length = 0;
			const GSErrCode err = Any_GetTextLineLength(dimElem.note, length);
			if (err != NoError)
			{
				DBGPrintlnf("[Error] %s " __FUNC__ " - ACAPI_Goodies(APIAny_GetTextLineLengthID)", ErrId2Name(err));
				break;
			}

			API_Coord pos;
			pos.x = (dimElem.pos.x + dimElemPrev.pos.x) / 2;
			pos.y = (dimElem.pos.y + dimElemPrev.pos.y) / 2;
			if (dimElem.note.noteAngle != 0) RotatePoint(pos, -dimElem.note.noteAngle);
			pos.x -= (length / 2);
			pos.y += (GetDrawingScale() / 2) / 1000;
			if (dimElem.note.noteAngle != 0) RotatePoint(pos, dimElem.note.noteAngle);

			dimElem.note.pos = pos;
			dimElem.note.fixPos = true;
			hasChanges = true;
		}
		if (err == NoError &amp;amp;&amp;amp; hasChanges)
		{
			ACAPI_CallUndoableCommand("Change Memo", [&amp;amp;]() -&amp;gt; GSErrCode {
			err = ACAPI_Element_ChangeMemo(i_guid, APIMemoMask_AdditionalPolygon, &amp;amp;memo);
			return NoError; });
			if (err == NoError)		DBGPrintlnf("[" __FUNC__ "] SUCCESS ACAPI_Element_ChangeMemo");
			else					DBGPrintlnf("[Error] %s " __FUNC__ " - ACAPI_Element_ChangeMemo()", ErrId2Name(err));
		}
	}
	ACAPI_DisposeElemMemoHdls(&amp;amp;memo);
	return err;
}&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Oct 2022 14:43:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275741#M3558</guid>
      <dc:creator>Erenford</dc:creator>
      <dc:date>2022-10-04T14:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Dimension text thru API disables 'Always Readable'?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275742#M3559</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
Could you specify the version of ArchiCAD you are using?</description>
      <pubDate>Wed, 30 Jan 2019 17:44:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275742#M3559</guid>
      <dc:creator>sznagy</dc:creator>
      <dc:date>2019-01-30T17:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Dimension text thru API disables 'Always Readable'?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275743#M3560</link>
      <description>&lt;BLOCKQUOTE&gt;sznagy wrote:&lt;BR /&gt;
Hello,&lt;BR /&gt;
&lt;BR /&gt;
Could you specify the version of ArchiCAD you are using?
&lt;/BLOCKQUOTE&gt;
that was ArchiCAD 22 3006 INT FULL&lt;BR /&gt;
&lt;BR /&gt;
I've recently updated to 5009 and tested again, still same output, the 'always readable' turns off.</description>
      <pubDate>Fri, 01 Feb 2019 03:08:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275743#M3560</guid>
      <dc:creator>Erenford</dc:creator>
      <dc:date>2019-02-01T03:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Dimension text thru API disables 'Always Readable'?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275744#M3561</link>
      <description>Yes, it is indeed a bug. I made an entry for it. Let me know if this is a great deal for the project, and we will do our best to fix it.</description>
      <pubDate>Mon, 04 Feb 2019 16:37:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275744#M3561</guid>
      <dc:creator>sznagy</dc:creator>
      <dc:date>2019-02-04T16:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Dimension text thru API disables 'Always Readable'?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275745#M3562</link>
      <description>&lt;BLOCKQUOTE&gt;sznagy wrote:&lt;BR /&gt;
Yes, it is indeed a bug. I made an entry for it. Let me know if this is a great deal for the project, and we will do our best to fix it.
&lt;/BLOCKQUOTE&gt;

Thank you, and yes it is important as we are creating lots of dimensions and it will be quite a hassle for our users to turn each back on manually.</description>
      <pubDate>Wed, 13 Feb 2019 05:17:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Moving-Dimension-text-thru-API-disables-Always-Readable/m-p/275745#M3562</guid>
      <dc:creator>Erenford</dc:creator>
      <dc:date>2019-02-13T05:17:14Z</dc:date>
    </item>
  </channel>
</rss>

