<?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 Dimensions. in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimensions/m-p/84474#M6434</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Can somebody please supply me with some sample code that displays how to add a dimension to the drawing. The sample projects don't show you how to do this and the finer points of the memo are elluding me.&lt;BR /&gt;&lt;BR /&gt;If the sample could say create 2 lines then create a dimension between the 2 end points of the line it will be enough and i'll be on my way!!&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/DIV&gt;</description>
    <pubDate>Fri, 04 Aug 2023 14:38:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-04T14:38:03Z</dc:date>
    <item>
      <title>Dimensions.</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimensions/m-p/84474#M6434</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Can somebody please supply me with some sample code that displays how to add a dimension to the drawing. The sample projects don't show you how to do this and the finer points of the memo are elluding me.&lt;BR /&gt;&lt;BR /&gt;If the sample could say create 2 lines then create a dimension between the 2 end points of the line it will be enough and i'll be on my way!!&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/DIV&gt;</description>
      <pubDate>Fri, 04 Aug 2023 14:38:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Dimensions/m-p/84474#M6434</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-04T14:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dimensions.</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimensions/m-p/84475#M6435</link>
      <description>I think the following code may be useful&lt;BR /&gt;
&lt;BR /&gt;
bool InsertDimension(double dist, int numCoords, API_Coord *coords, API_Coord *ref)&lt;BR /&gt;
{&lt;BR /&gt;
API_Element element;&lt;BR /&gt;
API_ElementMemo memo;&lt;BR /&gt;
OSErr err;&lt;BR /&gt;
Char hState;&lt;BR /&gt;
&lt;BR /&gt;
	memset(&amp;amp;element, 0, sizeof(API_Element));&lt;BR /&gt;
	memset(&amp;amp;memo, 0, sizeof(API_ElementMemo));&lt;BR /&gt;
	memo.dimElems = (API_DimElem **) BMAllocateHandle(sizeod(API_DimElem)* numCoords, ALLOCATE_CLEAR, nil);&lt;BR /&gt;
	element.header.typeID = API_DimensionID;&lt;BR /&gt;
	element.header.layer = 1;&lt;BR /&gt;
	element.header.floorInd = 0;&lt;BR /&gt;
	element.header.defStaticDim = false;&lt;BR /&gt;
	element.header.detailedHoleDim = false;&lt;BR /&gt;
	element.header.compCoreOnly = false;&lt;BR /&gt;
	element.header.nominalHoleDim = false;&lt;BR /&gt;
	element.header.ed_origin = APIDimOrigin_ProjectZero;&lt;BR /&gt;
	element.header.ed_dimForm = 1;&lt;BR /&gt;
	element.header.ed_arrowAng = 1;&lt;BR /&gt;
	element.header.dimAppear = APIApp_Normal;&lt;BR /&gt;
	element.header.defWitnessForm = API_Wtn_Small;&lt;BR /&gt;
	element.header.defWitnessVal = 0.0;&lt;BR /&gt;
	element.header.textWay = APIDir_Parallel;&lt;BR /&gt;
	element.header.textPos = APIPos_Above;&lt;BR /&gt;
	element.header.linPen = 1;&lt;BR /&gt;
	element.header.defNote.notePen = 2;&lt;BR /&gt;
	element.header.defNote.noteSize = 2.0;&lt;BR /&gt;
	element.header.defNote.noteAngle = PI / 2.0;&lt;BR /&gt;
	element.header.defNote.noteFont = FindFont(“Arial Narrow Western”);&lt;BR /&gt;
	element.header.markerData.markerPen = 1;&lt;BR /&gt;
	element.header.markerData.markerSize = 2.0;&lt;BR /&gt;
	element.header.markerData.markerType = APIMark_SlashLine45;&lt;BR /&gt;
	element.header.nDimElem = numCoords;&lt;BR /&gt;
	element.header.direction.x = 1.0;&lt;BR /&gt;
	element.header.direction.y = 0.0;&lt;BR /&gt;
	element.header.refC.x = ref-&amp;gt;x;&lt;BR /&gt;
	element.header.refC.y = ref-&amp;gt;y + dest;&lt;BR /&gt;
&lt;BR /&gt;
hState = BMModifyHandleState((GSHandle) memo.dimElems, HANDLE_STATE_LOCK, 0);&lt;BR /&gt;
for(int i = 0; i &amp;lt; numCoords; i++)&lt;BR /&gt;
{&lt;BR /&gt;
(*memo.dimElems)&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;.base.loc = coords&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;;&lt;BR /&gt;
(*memo.dimElems)&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;.fixedPos = true;&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
BMModifyHandleState((GSHandle) memo.dimElems. HANDLE_STATE_SET, hState);&lt;BR /&gt;
&lt;BR /&gt;
err = ACAPI_Element_Create(&amp;amp;element, &amp;amp;memo);&lt;BR /&gt;
if(err!=noErr)&lt;BR /&gt;
{&lt;BR /&gt;
ACAPI_DISPOSEElemMemoHdls(&amp;amp;memo);&lt;BR /&gt;
	return false;&lt;BR /&gt;
}&lt;BR /&gt;
ACAPI_DISPOSEElemMemoHdls(&amp;amp;memo);&lt;BR /&gt;
dist += 0.35;&lt;BR /&gt;
return true;&lt;BR /&gt;
}</description>
      <pubDate>Mon, 28 Jul 2008 08:17:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Dimensions/m-p/84475#M6435</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-28T08:17:14Z</dc:date>
    </item>
  </channel>
</rss>

