<?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: Dimension witness gap settings in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67245#M7722</link>
    <description>That was it, Oleg. Thanks!!&lt;BR /&gt;
&lt;BR /&gt;
Yes, I was trying to set the defaults for the dimensions.</description>
    <pubDate>Thu, 10 Jun 2004 13:25:30 GMT</pubDate>
    <dc:creator>TomWaltz</dc:creator>
    <dc:date>2004-06-10T13:25:30Z</dc:date>
    <item>
      <title>Dimension witness gap settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67241#M7718</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I am trying to write an API which create dimensions in various situations, using a default made in the API.&lt;BR /&gt;&lt;BR /&gt;I have most of the settings figured out, but the witnessVal seting in API_DimElem is killing me. It's the setting for the gap between the end of a witness line and the element being dimensioned.&lt;BR /&gt;&lt;BR /&gt;Here is what I have so far:
&lt;UL&gt;
&lt;LI&gt;API_Element element, mask;&lt;BR /&gt;API_ElementMemo memo;&lt;BR /&gt;GSErrCode err;&lt;BR /&gt;//API_DimElem dimparts;&lt;BR /&gt;&lt;BR /&gt;BNZeroMemory (&amp;amp;element, sizeof (API_Element));&lt;BR /&gt;BNZeroMemory (&amp;amp;memo, sizeof (API_ElementMemo));&lt;BR /&gt;&lt;BR /&gt;element.header.typeID = API_DimensionID;&lt;BR /&gt;&lt;BR /&gt;err = ACAPI_Element_GetDefaults (&amp;amp;element, &amp;amp;memo);&lt;BR /&gt;if (err == NoError) &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ACAPI_ELEMENT_MASK_CLEAR (mask); &lt;BR /&gt;&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, ed_arrowAng);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, textPos);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, linPen);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, markerData.markerPen);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, markerData.markerSize);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, markerData.markerType);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, defNote.notePen);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, defNote.noteFont );&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, defNote.noteSize);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, dimAppear);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, defWitnessForm);&lt;BR /&gt;ACAPI_ELEMENT_MASK_SET (mask, API_DimElem, witnessVal);&lt;BR /&gt;&lt;BR /&gt;element.dimension.ed_arrowAng = 2; // 45 degree tickmark&lt;BR /&gt;element.dimension.textPos = API_TextPosID (APIPos_Above);&lt;BR /&gt;element.dimension.linPen = 164; // dimension line pen&lt;BR /&gt;element.dimension.markerData.markerPen = 166 ;// tickmark pen&lt;BR /&gt;element.dimension.markerData.markerSize = 2.6; // tickmark size&lt;BR /&gt;element.dimension.markerData.markerType = API_MarkerID(APIMark_SlashLine45);// tickmark type&lt;BR /&gt;element.dimension.defNote.notePen = element.dimension.linPen; // text pen&lt;BR /&gt;element.dimension.defNote.noteFont = 87; // Tekton Pro&lt;BR /&gt;element.dimension.defNote.noteSize = 2.468265; // 7.00 points&lt;BR /&gt;element.dimension.dimAppear = API_AppearID(APIApp_Normal); // Normal Dimensions&lt;BR /&gt;element.dimension.defWitnessForm = API_WitnessID(APIWtn_Large); // Dynamic Witness Line&lt;BR /&gt;// ----------------------------------------------------&lt;BR /&gt;// Problem Here&lt;BR /&gt;dimparts.witnessVal = 2; // Witness line gap, compiling, but having no effect&lt;BR /&gt;//memo.dimension.witnessVal = API_DimElem(witnessVal, 2); // Not compiling&lt;BR /&gt;// .... to here&lt;BR /&gt;// ----------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;ACAPI_Element_ChangeDefaults (&amp;amp;element, &amp;amp;memo, &amp;amp;mask);&lt;S&gt;[list=]&lt;/S&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;BR /&gt;I feel like there's something simple I'm missing.&lt;BR /&gt;&lt;BR /&gt;I was hoping to work in a variable that checks the scale, and adjusts the witnessVal based on it, but right now I'll be happy just to set tha blasted thing!&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 10:22:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67241#M7718</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2023-08-07T10:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension witness gap settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67242#M7719</link>
      <description>Hi Tom,&lt;BR /&gt;
&lt;BR /&gt;
We'll have to wait for Ralph or Oleg to set us straight (or maybe Ferenc or someone else will join us?) ... but writing as another API newbie, the docs indicate that if you want the witnessVal to be treated as a gap, that you have to set witnessForm to APIWtn_Fix  (an enum).  Might be related to why setting the value doesn't do anything for you?&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure what you mean by:&lt;BR /&gt;

&lt;PRE&gt;memo.dimension.witnessVal = API_DimElem(witnessVal, 2);&lt;/PRE&gt;

The field of the API_ElementMemo struct is dimElems, not dimension, and that is a ** to an API_DimElem, and you're using API_DimElem as some kind of constructor that I don't recognize.  But, I'm really rusty!!&lt;BR /&gt;
&lt;BR /&gt;
Wish I was more up to speed to help more specifically, and hope I'm not too far off track to steer you in the wrong direction above.&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Thu, 10 Jun 2004 05:26:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67242#M7719</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-06-10T05:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension witness gap settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67243#M7720</link>
      <description>&lt;BLOCKQUOTE&gt;I'm not sure what you mean by:&lt;BR /&gt;
&lt;BR /&gt;
Code:&lt;BR /&gt;
memo.dimension.witnessVal = API_DimElem(witnessVal, 2);
&lt;/BLOCKQUOTE&gt;

honestly, Karl, I'm not to sure either!! &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
I'm just having a hard time getting the syntax to set the variable witnessVal, and was trying different things to get it to work. I'm new enought to C++ that the basic syntax on struct and enum is a little confusing sometimes, especially since GS seems a little inconsistant sometimes.</description>
      <pubDate>Thu, 10 Jun 2004 09:02:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67243#M7720</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2004-06-10T09:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension witness gap settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67244#M7721</link>
      <description>I am not sure, that I have understood you. Do you want to change dimension tool defaults ?&lt;BR /&gt;
If you want that it is not required to use API_DimElem and even API_ElementMemo.&lt;BR /&gt;
( It will be required at dims creation on the floor plan and it is more complex a task )&lt;BR /&gt;
&lt;BR /&gt;
Try this hints.&lt;BR /&gt;
&lt;BR /&gt;
err = ACAPI_Element_GetDefaults (&amp;amp;element, 0);&lt;BR /&gt;
 &lt;BR /&gt;
What is it  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_eek.gif" style="display : inline;" /&gt; ? Delete this line.&lt;BR /&gt;
ACAPI_ELEMENT_MASK_SET (mask, API_DimElem, witnessVal); &lt;BR /&gt;
&lt;BR /&gt;
Add instead of it:&lt;BR /&gt;
ACAPI_ELEMENT_MASK_SET (mask, API_DimensionType, defWitnessVal); &lt;BR /&gt;
&lt;BR /&gt;
Also add (I dont remember is it value in meters or mm :&lt;BR /&gt;
element.dimension.defWitnessVal = 2; // Default gap (APIWtn_Fix) or length (APIWtn_Large) &lt;BR /&gt;
&lt;BR /&gt;
And then:&lt;BR /&gt;
ACAPI_Element_ChangeDefaults (&amp;amp;element, 0, &amp;amp;mask);&lt;BR /&gt;
&lt;BR /&gt;
PS: &lt;BR /&gt;
By the way, you can use enums just as value (for example):&lt;BR /&gt;
element.dimension.dimAppear = APIApp_Normal; // Normal Dimensions &lt;BR /&gt;
element.dimension.defWitnessForm = APIWtn_Large; // Dynamic Witness Line &lt;BR /&gt;
&lt;BR /&gt;
Instead of:&lt;BR /&gt;
element.dimension.dimAppear = API_AppearID (APIApp_Normal); // Normal Dimensions &lt;BR /&gt;
element.dimension.defWitnessForm = API_WitnessID (APIWtn_Large); // Dynamic Witness Line &lt;BR /&gt;
&lt;BR /&gt;
Good luck</description>
      <pubDate>Thu, 10 Jun 2004 09:49:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67244#M7721</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2004-06-10T09:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dimension witness gap settings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67245#M7722</link>
      <description>That was it, Oleg. Thanks!!&lt;BR /&gt;
&lt;BR /&gt;
Yes, I was trying to set the defaults for the dimensions.</description>
      <pubDate>Thu, 10 Jun 2004 13:25:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Dimension-witness-gap-settings/m-p/67245#M7722</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2004-06-10T13:25:30Z</dc:date>
    </item>
  </channel>
</rss>

