<?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 Change/modify dimension in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-modify-dimension/m-p/235500#M2999</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;I've created a simple code that will read all the API_DimElem from memo then combine consecutive equidistant dimensions (dimVal). Then use ACAPI_Element_Change() to update the element but it returns API_BADPARS.&lt;BR /&gt;
&lt;PRE&gt;/***** code for creating newDimElems here *****/

// change/update element
dimCnt = newDimElems.GetSize();
memo.dimElems = (API_DimElem**)BMAllocateHandle(sizeof(API_DimElem) * dimCnt, ALLOCATE_CLEAR, 0);
for (UInt32 i = 0; i &amp;lt; dimCnt; ++i)
	(*memo.dimElems)&lt;I&gt; = newDimElems&lt;I&gt;;
API_Element mask;
ACAPI_ELEMENT_MASK_CLEAR(mask);
ACAPI_ELEMENT_MASK_SET(mask, API_DimensionType, nDimElem);
elem.dimension.nDimElem = dimCnt;
err = ACAPI_Element_Change(&amp;amp;elem, &amp;amp;mask, &amp;amp;memo, APIMemoMask_All, true);&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
Any idea where I go wrong?&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Sep 2021 11:35:24 GMT</pubDate>
    <dc:creator>ReignBough</dc:creator>
    <dc:date>2021-09-14T11:35:24Z</dc:date>
    <item>
      <title>Change/modify dimension</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-modify-dimension/m-p/235500#M2999</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I've created a simple code that will read all the API_DimElem from memo then combine consecutive equidistant dimensions (dimVal). Then use ACAPI_Element_Change() to update the element but it returns API_BADPARS.&lt;BR /&gt;
&lt;PRE&gt;/***** code for creating newDimElems here *****/

// change/update element
dimCnt = newDimElems.GetSize();
memo.dimElems = (API_DimElem**)BMAllocateHandle(sizeof(API_DimElem) * dimCnt, ALLOCATE_CLEAR, 0);
for (UInt32 i = 0; i &amp;lt; dimCnt; ++i)
	(*memo.dimElems)&lt;I&gt; = newDimElems&lt;I&gt;;
API_Element mask;
ACAPI_ELEMENT_MASK_CLEAR(mask);
ACAPI_ELEMENT_MASK_SET(mask, API_DimensionType, nDimElem);
elem.dimension.nDimElem = dimCnt;
err = ACAPI_Element_Change(&amp;amp;elem, &amp;amp;mask, &amp;amp;memo, APIMemoMask_All, true);&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
Any idea where I go wrong?&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 11:35:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-modify-dimension/m-p/235500#M2999</guid>
      <dc:creator>ReignBough</dc:creator>
      <dc:date>2021-09-14T11:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Change/modify dimension</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-modify-dimension/m-p/235501#M3000</link>
      <description>&lt;B&gt;UPDATE&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Instead of creating dimensions then changing it, I just process the coordinates before creating the dimension. (As before, combining equal consecutive "computed" dimVal.)&lt;BR /&gt;

&lt;PRE&gt;Raw dimensions &amp;lt;-- dimension is not yet created
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (18.45889129, 30.99275442, 0.00000000) API_NoteContent_Measured 0.00000
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.12751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.40751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 --\ distance
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.68751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000   | from
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.96751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000   | previous
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (21.24751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000   | dimElem
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (21.52751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000   | is equal
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (21.80751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000   | to 280
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.08751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000   | (equidistant)
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.36751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000 --/
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.52751402, 29.79275442, 12.00000000) API_NoteContent_Measured 0.00000
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (23.72751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000

Filtered dimensions (newDimElems) &amp;lt;-- dimension is not yet created, this is the above after being processed
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (18.45889129, 30.99275442, 0.00000000) API_NoteContent_Measured 0.00000
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (20.12751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.36751369, 30.99275442, 12.00000000) API_NoteContent_Custom &amp;lt;MeasuredValue&amp;gt; 8 EQ PARTS
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (22.52751402, 29.79275442, 12.00000000) API_NoteContent_Measured 0.00000
base.loc3D (0.00000000, 0.00000000, 0.00000000) pos3D (23.72751369, 30.99275442, 12.00000000) API_NoteContent_Measured 0.00000

Created dimensions
base.loc3D (23.72751369, 30.99275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Measured 0.00000
base.loc3D (22.52751402, 29.79275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Measured 1.20000
base.loc3D (22.36751369, 30.99275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Custom 160 8 EQ PARTS
base.loc3D (20.12751369, 30.99275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Measured 2.24000
base.loc3D (18.45889129, 30.99275442, 0.00000000) pos3D (0.00000000, 0.00000000, 0.00000000) API_NoteContent_Measured 1.66862&lt;/PRE&gt;

&lt;BR /&gt;
But the the generated dimension is not as expected.&lt;BR /&gt;</description>
      <pubDate>Mon, 11 Jan 2021 10:04:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-modify-dimension/m-p/235501#M3000</guid>
      <dc:creator>ReignBough</dc:creator>
      <dc:date>2021-01-11T10:04:23Z</dc:date>
    </item>
  </channel>
</rss>

