<?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: C++ API Examples in Python Scripts in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/387057#M875</link>
    <description>&lt;P&gt;For Attribute_Test we'll need the following template specializations:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;	// Template specializations here!
	// Anything that doesn't support GS::ValueToUniString will need to be explicitly implemented similar to this:
	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;char*&amp;gt; (char* cStr) {
		container.Push (GS::UniString (cStr));
	}

	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;const char*&amp;gt; (const char* cStr) {
		container.Push (GS::UniString (cStr));
	}

	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;const void*&amp;gt; (const void* printfStr) {
		container.Push (GS::UniString ((const char*)printfStr));
	}

	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;const GS::uchar_t*&amp;gt; (const GS::uchar_t* printfStr) {
		container.Push (GS::UniString (printfStr));
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Unfortunately I probably won't have time the coming weeks to look into the other issue on how to setup the global container correctly.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jul 2023 19:12:55 GMT</pubDate>
    <dc:creator>BerndSchwarzenbacher</dc:creator>
    <dc:date>2023-07-11T19:12:55Z</dc:date>
    <item>
      <title>C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386166#M864</link>
      <description>&lt;P&gt;Been working with the latest API with the intent to make available some of the features of the API examples to Python scripts. My idea is that Python is much easier to work with and doesn’t require a recompilation anytime a change is made. Very easy to experiment with. I also don’t want to reinvent the wheel since most of the functions of interest are already contained within the examples. Unfortunately, they are not in a form which can be immediately used, requiring one to recreate and compile the AddOn in a form more specific to one’s needs. It is much, much easier to experiment with a Python script. However, the present Python API has almost no access to the functions demoed in the C++ API examples. And, Graphisoft has indicated that they have no intention of upgrading the Python API in the near future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This why I would like to create parallel AddOn examples which would make those functions available. Actually, this is relatively straight forward, by just making the Graphisoft menu items available to a Python script and passing over the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, there is a problem. Graphisoft’s examples almost exclusively write their data/results to the session report via a variadic template (WriteReport). Completely worthless!! The data (output) is packed in a variadic argument and I am unable to unpack it or know how. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried using stdargs.h but just get a error on va_start of “va_start intrinsic only allowed in varags”. I also asked Graphisoft’s beta tech support to provide a solution but was just ignored. Understandable, since the beta site now has over 250 submittals. They are swamped.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone provide a means to unpack and use a variadic argument within a template which would provide access to all the results.&lt;/P&gt;
&lt;P&gt;template&amp;lt;typename... Args&amp;gt;&lt;/P&gt;
&lt;P&gt;void&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteReport (const char* format, Args&amp;amp;&amp;amp;... args)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACAPI_WriteReport (format, false, std::forward&amp;lt;Args&amp;gt; (args)...);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;Of course, I could just bypass the WriteReport function(s), but that would be a huge amount of work – not practical.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help. Help me, help you?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 10:23:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386166#M864</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2024-09-26T10:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386272#M865</link>
      <description>&lt;P&gt;Hi Gerry,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand you correctly, you want to replace &lt;STRONG&gt;WriteReport&lt;/STRONG&gt; with your own implementation right?&lt;BR /&gt;The easiest way I've found to unpack the arguments is recursion.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I think something like the following should do what you want: (&lt;A href="https://godbolt.org/z/abrbrGPaf" target="_blank" rel="noopener"&gt;Live Demo on Godbolt&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;// Adapted from:
// https://learn.microsoft.com/en-us/cpp/cpp/ellipses-and-variadic-templates?view=msvc-170

#include &amp;lt;iostream&amp;gt;

using namespace std;

 void print() {
     cout &amp;lt;&amp;lt; endl;
 }

 template &amp;lt;typename T&amp;gt; void print(const T&amp;amp; t) {
     cout &amp;lt;&amp;lt; t &amp;lt;&amp;lt; endl;
 }

 template &amp;lt;typename First, typename... Rest&amp;gt; void print(const First&amp;amp; first, const Rest&amp;amp;... rest){
     cout &amp;lt;&amp;lt; first &amp;lt;&amp;lt; ", ";
     print(rest...); // recursive call using pack expansion syntax
 }

 // WriteReport replacement to substitute functionality and ignore first 'format' parameter.
 template&amp;lt;typename... Args&amp;gt;
 void WriteReport (const char* /*format*/, Args&amp;amp;&amp;amp;... args)
 {
     print (std::forward&amp;lt;Args&amp;gt; (args)...);
 }

int main()
{
    WriteReport("this is ignored", 1, 3, 4, 5);
    WriteReport("this is ignored", 1.23, "some string");
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in this example, you can change &lt;STRONG&gt;print&lt;/STRONG&gt; to do different things of course. The key is the recursive implementation of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;BR /&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 21:14:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386272#M865</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-04T21:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386303#M866</link>
      <description>&lt;P&gt;Typed in the above but get a compile error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;binary '&amp;lt;&amp;lt;': no operator found which takes a right hand operand of type 'const First' (or there is no acceptable conversion)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;binary '&amp;lt;&amp;lt;' : no operator found which takes a right-hand operand of type 'const T' (or there is no acceptable conversion)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;using VS Studio 2019 on windows 10&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 04:23:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386303#M866</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-07-05T04:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386369#M867</link>
      <description>&lt;P&gt;The error messages should continue with something like:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;.\main.cpp(10): error C2679: binary '&amp;lt;&amp;lt;': no operator found which takes a right-hand operand of type 'const T' (or there is no acceptable conversion)
        with
        [
            T=MissingType
        ]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This means you are calling the &lt;STRONG&gt;WriteReport&lt;/STRONG&gt; (which calls &lt;STRONG&gt;print&lt;/STRONG&gt; which calls &lt;STRONG&gt;operator&amp;lt;&amp;lt;&lt;/STRONG&gt;) function with a type/class which doesn't have an '&amp;lt;&amp;lt;' operator defined.&lt;/P&gt;
&lt;P&gt;So it depends on what you want to use inside the &lt;STRONG&gt;print&lt;/STRONG&gt; function.&lt;/P&gt;
&lt;P&gt;Probably easiest is to provide template specializations of the &lt;STRONG&gt;print&lt;/STRONG&gt; function for all missing types.&lt;/P&gt;
&lt;P&gt;So add functions like this to the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void print(const MissingType&amp;amp; value) {
    cout &amp;lt;&amp;lt; CONVERT_VALUE_TO_SOMETHING_PRINTABLE_HERE(value) &amp;lt;&amp;lt; endl;
// maybe GS::ValueToUniString(value) works
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 19:57:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386369#M867</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-05T19:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386372#M868</link>
      <description>&lt;P&gt;Thanks for the prompt reply -- I really appreciate it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it still won't compile. I don't understand where to place the code&lt;/P&gt;
&lt;P&gt;For example: what do I put in for"missingType":&lt;/P&gt;
&lt;P&gt;Do I add the function into a Template? what template?&lt;/P&gt;
&lt;P&gt;i believe WriteRport is converting the UniString to char first -- could be wrong?&lt;/P&gt;
&lt;P&gt;Could you provide the full code? i am really lost with templates?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 20:58:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386372#M868</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-07-05T20:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386418#M869</link>
      <description>&lt;P&gt;I understand that it's hard to wrap your head around templates at first and I don't really know how to explain it concisely.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7804"&gt;@poco2013&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Could you provide the full code?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To provide a full code, I first would have to now what types you are using.&lt;BR /&gt;Can you send me the code you are working on somehow? PM, GitHub, GitLab or Mail (check my website for the contact)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7804"&gt;@poco2013&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;For example: what do I put in for"missingType":&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You'd need to make a separate print function for each &lt;STRONG&gt;MissingType&lt;/STRONG&gt;, where &lt;STRONG&gt;MissingType&lt;/STRONG&gt; is given in the error messages:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;.\main.cpp(10): error C2679: binary '&amp;lt;&amp;lt;': no operator found which takes a right-hand operand of type 'const T' (or there is no acceptable conversion)
        with
        [
            T=MissingType
        ]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 08:41:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386418#M869</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-06T08:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386448#M870</link>
      <description>&lt;P&gt;Here are typical Archicad statements that I am trying to convert:&lt;/P&gt;
&lt;P&gt;WriteReport ("# List attributes:");&lt;BR /&gt;WriteReport ("# - scan all attribute types and show the number of each type");&lt;BR /&gt;WriteReport ("# - deleted instances will be called \"DEL\"");&lt;/P&gt;
&lt;P&gt;WriteReport ("%s: %d", AttrID_To_Name (typeID), attributes.GetSize ());&lt;/P&gt;
&lt;P&gt;char guidStr[64];&lt;BR /&gt;APIGuid2GSGuid (attrib.header.guid).ConvertToString (guidStr);&lt;BR /&gt;WriteReport (" [%3s] {%s} \"%s\"", attrib.header.index.ToUniString ().ToCStr ().Get (), guidStr, attrib.header.name);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Archicad Copies the arguments in WriteReport to its function ACAPI_WriteReport with a variadic template in the file APICommon.h&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;template&amp;lt;typename... Args&amp;gt;&lt;BR /&gt;void WriteReport (const char* /*format*/, Args&amp;amp;&amp;amp;... args)&lt;BR /&gt;{&lt;BR /&gt;ACAPI_WriteReport (format, false, std::forward&amp;lt;Args&amp;gt; (args)...);&lt;BR /&gt;}.&lt;/P&gt;
&lt;P&gt;Their WriteReport writes to session info, note the false argument, which is worthless. What I want to do is to remove ACAPI_WriteReport and inside the template, and write the variadic argument to a Array so that they can be transferred to another program (Python), I could bypass WriteReport directly, but it is used in hundreds of places in each AddOn -- so not practical. Basically I am trying to stop writing to the session report and capture the data directly.&lt;/P&gt;
&lt;P&gt;I am still playing with your suggestions. Thanks for your previous help. I think this is just a mater of understanding what the compiler expects, but can't find any documentation. Most is either on the elementary level or too complicated to follow. However, i appreciate your offers to help- I am just a little slow.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 12:30:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386448#M870</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-07-06T12:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386462#M871</link>
      <description>&lt;P&gt;In your example there are only the following types given to &lt;STRONG&gt;WriteReport&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;char*&lt;/LI&gt;
&lt;LI&gt;GS::USize&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;So I've simplified your example to pass such values directly instead of grabbing them from attributes etc.&lt;/P&gt;
&lt;P&gt;If you are passing other types, my example code might not work and you'll need to provide more template specializations!&lt;/P&gt;
&lt;P&gt;So please check first if you can run it just with the example WriteReport lines you've given.&lt;BR /&gt;We then can add further specializations if you provide me with the failing types.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I've chosen GS::UniString as the storage type for now since I don't know how you could make a storage which takes all the possible types.&lt;/P&gt;
&lt;P&gt;This would be considerably more work if at all possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the example code. Call the function &lt;STRONG&gt;TestAddingToArrayIfWriteReportIsCalled ()&lt;/STRONG&gt; somehow within an Add-On.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;class WRArray {
public:
	GS::Array&amp;lt;GS::UniString&amp;gt; container;

	static WRArray&amp;amp; WRArray::GetInstance ()
	{
		static WRArray instance;
		return instance;
	}

	void addToArray () {
		return;
	}

	template &amp;lt;typename T&amp;gt;
	void addToArray (const T tValue) {
		container.Push (GS::ValueToUniString (tValue));
	}

	template &amp;lt;typename First, typename... Rest&amp;gt; void addToArray (const First&amp;amp; first, const Rest&amp;amp;... rest) {
		addToArray (first);
		addToArray (rest...); // recursive call using pack expansion syntax
	}

	// Template specializations here!
	// Anything that doesn't support GS::ValueToUniString will need to be explicitly implemented similar to this:
	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;&amp;gt; (const char* cStr) {
		container.Push (GS::UniString (cStr));
	}

};


template&amp;lt;typename... Args&amp;gt;
void WriteReport (const char* /*format*/, Args&amp;amp;&amp;amp;... args)
{
	//ACAPI_WriteReport (format, false, std::forward&amp;lt;Args&amp;gt; (args)...);
	WRArray::GetInstance ().addToArray (std::forward&amp;lt;Args&amp;gt; (args)...);
}

void TestAddingToArrayIfWriteReportIsCalled ()
{
	// These don't add anything to the array since we are ignoring the format string
	WriteReport ("# List attributes:");
	WriteReport ("# - scan all attribute types and show the number of each type");
	WriteReport ("# - deleted instances will be called \"DEL\"");

	// Format string will be ignored. First entry in array will be "API_PenID"
	WriteReport ("%s: %d", "API_PenID", GS::USize(32));

	char guidStr[64] = "{000000-0000-0000-000000}";
	WriteReport (" [%3s] {%s} \"%s\"", "some c string", guidStr, "PEN1");

	for (const GS::UniString&amp;amp; item : WRArray::GetInstance ().container) {
		// Do something else here, just demonstrating that we have the values in an array now.
		ACAPI_WriteReport (item, true);
	}
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 14:53:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386462#M871</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-06T14:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386494#M872</link>
      <description>&lt;P&gt;OK Were sneaking up on it. The class compiled OK. But as soon as i add the line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WRArray::GetInstance().addToArray(std::forward&amp;lt;Args&amp;gt;(args)...);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to the template&amp;lt;typename... Args&amp;gt;&lt;/P&gt;
&lt;P&gt;i get the compile error of&lt;/P&gt;
&lt;P&gt;C2665&amp;nbsp; GS::valuetostr: none of the 29 overloads could convert all the argument types&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still working on it.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 18:39:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386494#M872</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-07-06T18:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386930#M873</link>
      <description>&lt;P&gt;You said, that you are using the C++ API Example projects. Which one are you looking at exactly?&lt;BR /&gt;Because I've just tried with the &lt;STRONG&gt;Element_Test&lt;/STRONG&gt; example from the &lt;STRONG&gt;AC26 DevKit&lt;/STRONG&gt;.&lt;BR /&gt;I replaced &lt;STRONG&gt;WriteReport&lt;/STRONG&gt; with the class + new implementation of the function in the &lt;STRONG&gt;APICommon.h&lt;/STRONG&gt; file of that project and I don't get any errors like you've said.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately the code doesn't work directly though. Somehow the array I defined is not as global as I've thought &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;BR /&gt;So that part would need some work still as well.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 07:18:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386930#M873</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-11T07:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386939#M874</link>
      <description>&lt;P&gt;Using DevKit 27 Attribute_Test - VS 2019&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 08:11:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/386939#M874</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-07-11T08:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/387057#M875</link>
      <description>&lt;P&gt;For Attribute_Test we'll need the following template specializations:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;	// Template specializations here!
	// Anything that doesn't support GS::ValueToUniString will need to be explicitly implemented similar to this:
	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;char*&amp;gt; (char* cStr) {
		container.Push (GS::UniString (cStr));
	}

	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;const char*&amp;gt; (const char* cStr) {
		container.Push (GS::UniString (cStr));
	}

	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;const void*&amp;gt; (const void* printfStr) {
		container.Push (GS::UniString ((const char*)printfStr));
	}

	template&amp;lt;&amp;gt;
	void addToArray&amp;lt;const GS::uchar_t*&amp;gt; (const GS::uchar_t* printfStr) {
		container.Push (GS::UniString (printfStr));
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Unfortunately I probably won't have time the coming weeks to look into the other issue on how to setup the global container correctly.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 19:12:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/387057#M875</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-11T19:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/387064#M876</link>
      <description>&lt;P&gt;Now i am getting the message that "addToArray is not a Template" Looks like a template to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to thank you for your help, I got a lot of new ideas now on how to approach this problem. i will continue my investigation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again, i would not spend anymore of your time on this, I have a lot of new ideas now. Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 21:17:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/387064#M876</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-07-11T21:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: C++ API Examples in Python Scripts</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/387065#M877</link>
      <description>&lt;P&gt;You're welcome!&lt;BR /&gt;&lt;BR /&gt;Just a last thought for the latest error: The code new code needs to go into the class at the same place where I've put previous template specializations. Maybe that's the issue for "addToArray is not a Template"&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 21:22:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/C-API-Examples-in-Python-Scripts/m-p/387065#M877</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-07-11T21:22:08Z</dc:date>
    </item>
  </channel>
</rss>

