<?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: referencing by name, not index number in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68883#M7725</link>
    <description>Akos, &lt;BR /&gt;
&lt;BR /&gt;
that seemed to be the funciton I was looking for,&lt;BR /&gt;
&lt;BR /&gt;
When I compiled, though, the compiler gave me an error that ACAPI_Attribute_Search () requires a header, not an attribute.&lt;BR /&gt;
&lt;BR /&gt;
Should that line then read:
&lt;PRE&gt;ACAPI_Attribute_Search (&amp;amp;attr.header)&lt;/PRE&gt;</description>
    <pubDate>Mon, 14 Jun 2004 14:08:54 GMT</pubDate>
    <dc:creator>TomWaltz</dc:creator>
    <dc:date>2004-06-14T14:08:54Z</dc:date>
    <item>
      <title>referencing by name, not index number</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68881#M7723</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I am digging through the settings for defaults of different element types, and I found that many attributes are referenced by number, not name.&lt;BR /&gt;&lt;BR /&gt;So if I want to set the font to "Arial" or the layer to "Text - Notes," I have to reference them by their index number (??!??!), not their actual name.&lt;BR /&gt;&lt;BR /&gt;Is there any way around this that I'm not seeing?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 10:22:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68881#M7723</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2023-08-07T10:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: referencing by name, not index number</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68882#M7724</link>
      <description>Tom,&lt;BR /&gt;
&lt;BR /&gt;
The element structures store only the indices of the attributes they refer to. The reasons behind that are synchronization and memory saving.&lt;BR /&gt;
&lt;BR /&gt;
So, if you know the name of the attribute you'd like to set for an element, then for example in the layer case:&lt;BR /&gt;

&lt;PRE&gt;API_Attribute attr;
BNZeroMemory (&amp;amp;attr, sizeof (API_Attribute));
attr.header.typeID = API_LayerID;
CHCopyC ("Text - Notes", attr.header.name);

// now see if this layer exists
if (ACAPI_Attribute_Search (&amp;amp;attr) == NoError) {
    // bingo! put the index in the element's header
    element.header.layer = attr.header.index;
} else {
    // exercise for the reader
    // e.g. create a new, or
    // search for another suitable layer 
}&lt;/PRE&gt;

HTH,&lt;BR /&gt;
&lt;BR /&gt;
Akos</description>
      <pubDate>Mon, 14 Jun 2004 07:46:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68882#M7724</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2004-06-14T07:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: referencing by name, not index number</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68883#M7725</link>
      <description>Akos, &lt;BR /&gt;
&lt;BR /&gt;
that seemed to be the funciton I was looking for,&lt;BR /&gt;
&lt;BR /&gt;
When I compiled, though, the compiler gave me an error that ACAPI_Attribute_Search () requires a header, not an attribute.&lt;BR /&gt;
&lt;BR /&gt;
Should that line then read:
&lt;PRE&gt;ACAPI_Attribute_Search (&amp;amp;attr.header)&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Jun 2004 14:08:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68883#M7725</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2004-06-14T14:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: referencing by name, not index number</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68884#M7726</link>
      <description>TomWaltz,&lt;BR /&gt;
&lt;BR /&gt;
Yes, you're right. That was a typo on Akos' part.</description>
      <pubDate>Mon, 21 Jun 2004 12:58:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/referencing-by-name-not-index-number/m-p/68884#M7726</guid>
      <dc:creator>Andras Babos</dc:creator>
      <dc:date>2004-06-21T12:58:40Z</dc:date>
    </item>
  </channel>
</rss>

