<?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: [newbie] how about 'hello world' in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72293#M7768</link>
    <description>Thank You Karl. &lt;BR /&gt;
 &lt;BR /&gt;
Your blank solution is great &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; i Will use it as template if I will not be able to run wizard in VS2005. Unfortunately installation option is invisible if You don't have VS2003 installed. &lt;BR /&gt;
 &lt;BR /&gt;
Thanks again &lt;BR /&gt;
Maciek</description>
    <pubDate>Wed, 07 Nov 2007 18:24:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-11-07T18:24:37Z</dc:date>
    <item>
      <title>[newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72252#M7727</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;When I wrote my introduction to the forum, Karl said
&lt;BLOCKQUOTE&gt;Looking at the PDF link that you posted, I think you're in for some "fun", Tor Jørgen! Welcome!&lt;/BLOCKQUOTE&gt;
I'm glad for the welcome, but I worry that maybe I'm in over my head - I guess thats where the fun starts... &lt;IMG style="display: inline;" src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" border="0" /&gt;&lt;BR /&gt;&lt;BR /&gt;I'll just wait with the questions connected with my project and start really simple;&lt;BR /&gt;&lt;BR /&gt;- in most of the languages I've looked at, there's always an example of how to write the simple 'hello world'-snippet. How do I do that in an addon?&lt;BR /&gt;- and then how does the real workprocess go, I'm thinking of debugging and setting breakpoints and beeing able to step through the code to see what happens where, and why... and how is the interaction with ArchiCAD?&lt;BR /&gt;&lt;BR /&gt;-- &lt;BR /&gt;Regards,&lt;BR /&gt;Tor Jørgen &lt;IMG style="display: inline;" src="https://community.graphisoft.com/legacyfs/online/emojis/icon_eek.gif" border="0" /&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 10:21:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72252#M7727</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-07T10:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72253#M7728</link>
      <description>&lt;BLOCKQUOTE&gt;Tor wrote:&lt;BR /&gt;- in most of the languages I've looked at, there's always an example of how to write the simple 'hello world'-snippet. How do I do that in an addon?&lt;/BLOCKQUOTE&gt;
Have you downloaded the ArchiCAD API Developer Kit yet? You will find both documentation and example projects in the kit. The example projects are mostly pretty basic, and give you an overview of what the API can do. You can use an example project as the basis for starting your own too.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;Tor wrote:&lt;BR /&gt;- and then how does the real workprocess go, I'm thinking of debugging and setting breakpoints and beeing able to step through the code to see what happens where, and why... and how is the interaction with ArchiCAD?&lt;/BLOCKQUOTE&gt;
You can debug, set break points, inspect variable/memory, etc. You need to set ArchiCAD as the target executable in your runtime settings so that it is launched when you 'Run' your add-on, and the build settings need to be appropriate for debugging, e.g. low optimisation. I could be more specific if you can provide a brief description of the platform you are using, e.g. OS, IDE/compiler, AC version, etc.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Ralph.</description>
      <pubDate>Tue, 15 Jun 2004 20:28:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72253#M7728</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2004-06-15T20:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72254#M7729</link>
      <description>&lt;BLOCKQUOTE&gt;TJ wrote:&lt;BR /&gt;- in most of the languages I've looked at, there's always an example of how to write the simple 'hello world'-snippet. How do I do that in an addon?&lt;/BLOCKQUOTE&gt;

Just to add 2 cents to Ralph's excellent reply...&lt;BR /&gt;
&lt;BR /&gt;
The equivalent to "Hello World" might be an add-on with one menu command that displays "Hello World" in the report window when the command is chosen.&lt;BR /&gt;
&lt;BR /&gt;
You can create such an add-on as an exercise by rewriting (mostly cutting) the 3D_Test example, and 3D_Manager.c in particular which uses the WriteReport function.  I'm on a deadline or I'd do it and post it ...&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Karl</description>
      <pubDate>Tue, 15 Jun 2004 21:35:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72254#M7729</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-06-15T21:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72255#M7730</link>
      <description>As someone who is VERY new the the Archicad API, I can tell you that a good thing to do it both to study the examples they give you with the SDK, and to try doing a File - &amp;gt; New Graphisoft Addon (using the templates in the SDK) to see what is actuallly *required* in any add-ons you create.&lt;BR /&gt;
&lt;BR /&gt;
I'm just completing an add-on which is meant to ease compliance with office standards, by settings up text,  dimension, &amp;amp; label settings (pens, sizes, fonts) and selecting a layer based on context (detail, section, or plan view, and current scale for plan view).&lt;BR /&gt;
&lt;BR /&gt;
I have a pretty weak C/C++ background, but have done enough CAD programming that it was just a matter of knowing where to look.&lt;BR /&gt;
&lt;BR /&gt;
I'm also on the Mac with CodeWarrior 10, so let me know if I can help.</description>
      <pubDate>Wed, 16 Jun 2004 00:49:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72255#M7730</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2004-06-16T00:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72256#M7731</link>
      <description>As a beginning ArchiCAD-developer myself, I want to help a hand &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;
Maybe it's not too bad to do the complete process step by step, so we actually make the Hello World from scratch. But the problem is: it takes time, I did had to do some nasty things to get it running and... the API is still using Visual C++ 6.0 and we can only hope that the procedure will stay (more or less) the same in upcoming versions of ArchiCAD and the API.&lt;BR /&gt;
&lt;BR /&gt;
I'll try to describe it in this thread (would be fun) but I expect serious "bugs" or ways-of-work. Maybe this would be the place to let it be proofread and then finalise it into a nice and clean "real" version.</description>
      <pubDate>Wed, 16 Jun 2004 06:24:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72256#M7731</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-16T06:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72257#M7732</link>
      <description>&lt;B&gt;STEP 1 : producing the correct ID's with the manager tool&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
On Windows, go to:&lt;BR /&gt;
"C:\Program Files\Graphisoft\API Development Kit 5\Support\Tools\Win\AddOn Management" and start the AddOnAdmin.exe&lt;BR /&gt;
This is the place to generate the unique Developer and Addon-ID's.&lt;BR /&gt;
&lt;BR /&gt;
Start a New database and enter your (unique) Developer ID (something like XXXX). Once that has worked, a new XML-file has been generated which we need for the addon-ID's.&lt;BR /&gt;
&lt;BR /&gt;
From there we can call for a "New Addon". Now you need to provide your registration code. You can type a name for the Addon and a unique LocalID will be generated.&lt;BR /&gt;
&lt;BR /&gt;
As it happens, this "unique" local ID is not so unique: with one Developer ID you can generate 256 ID's, but a new database will generate the same ID's. In practice, unless you need to develop more then 256 Addon's, this is not a problem. During development you can reuse the same ID over &amp;amp; over.&lt;BR /&gt;
&lt;BR /&gt;
(See the getting started post from Karel on this subject)&lt;BR /&gt;
&lt;BR /&gt;
To be able to use these numbers in the development tool, you can export the database as a header file: "Save Database As..." and choose *.h&lt;BR /&gt;
&lt;BR /&gt;
The end result of step 1:
&lt;PRE&gt;// *****************************************************************************
// tutorial.h
//                             AddOn unique IDs 
//
// *****************************************************************************
// -----------------------------------------------------------------
// Developer: 'XXXX'
// -----------------------------------------------------------------
#define TUTORIAL_H		1234567890
// Unnamed
#define TUTORIAL_H_HelloWorld		0987654321&lt;/PRE&gt;
(Your numbers will vary, apparantly)</description>
      <pubDate>Wed, 16 Jun 2004 07:33:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72257#M7732</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-16T07:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72258#M7733</link>
      <description>&lt;B&gt;STEP 2 : creating a skeleton addon&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
(I'll explain it for Windows, but I guess it won't be too much different on the Mac)&lt;BR /&gt;
&lt;BR /&gt;
In Visual Studio 6.0 you can create a new ArchiCAD Add-on with the provided wizard. Select the API DevKit folder and (optionally) add support for dialogs &amp;amp; input/output. We won't need them for "Hello World".&lt;BR /&gt;
&lt;BR /&gt;
Let it generate a complete project and try to compile. It won't work!
&lt;PRE&gt;RFIX.WIN\..\Debug\HelloWorldFix.grc.rc2 (26): error RC2104 : undefined keyword or key name: WIN_LANGUAGE_ID&lt;/PRE&gt;

&lt;B&gt;Add the Developer ID&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Before we solve that problem (and let me know if I do this the wrong way), we have to add the developer ID from Step 1 into the code.&lt;BR /&gt;
&lt;BR /&gt;
Open the "HelloWorldFix.grc" file. It contains the version resource &amp;amp; the DevID resource. Replace the "1" and the other "1" with the ID's. Watch out, you have to add the integer and not the string for the Developer ID.&lt;BR /&gt;
So replace the first "1" with something like 1234567890 (not the XXXX) and replace the second "1" with something like 0987654321.&lt;BR /&gt;
&lt;BR /&gt;
As an alternative, you can include the exported database file (*.h) and use the defined ID's. It's up to you.&lt;BR /&gt;
&lt;BR /&gt;
You won't get any feedback whatsoever if this ID is correct, though... If it is, ArchiCAD will like the Addon, if it's not, it'll only work in the demo-version of ArchiCAD.&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Correct the missing keywords&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
This part is what I am not so sure about, but I've got it to work, so here it goes: the WIN_LANGUAGE_ID which is not recognised is actually defined in "GSLocalization.h". This file is included in the "HelloWorldFix.grc" file, which is used by the "Resource Conversion" program to generate a real resource file: "HelloWorldFix.grc.rc2".&lt;BR /&gt;
&lt;BR /&gt;
In the localization header, we can see some info about the different language versions of ArchiCAD. I wasn't so sure how to solve it, but I tried and the following got it going: I added a few extra defines in my header files, so the included Localization file can derive the correct definitions. Inside "HelloWorld.rc2" I added a few lines like this, after the #include &amp;lt;Windows.h&amp;gt;:
&lt;PRE&gt;#include &amp;lt;Windows.h&amp;gt;

#define INT__APP
#define INTERNAL_NAME "HelloWorld"
#define ORIGINAL_NAME "HelloWorld.apx"

#if !defined (WINDOWS)
#define WINDOWS
#endif&lt;/PRE&gt;
I guess the strings don't matter that much, but the first define made the lookup in the Localization header work.&lt;BR /&gt;
&lt;BR /&gt;
And yes, now it compiles fine.&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;checking the compiled APX&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Before we launch ArchiCAD, it's best to check the add-on in the Add-On Management tool. On the second tab, you can load a file (that is, the  APX-file). It everything works right, it will be displayed in Green and the resource info is shown.&lt;BR /&gt;
&lt;BR /&gt;
If it doesn't show anything, then ArchiCAD won't accept the addon, so save yourself the trouble trying.</description>
      <pubDate>Wed, 16 Jun 2004 12:05:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72258#M7733</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-16T12:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72259#M7734</link>
      <description>&lt;B&gt;STEP 3 : about Custom Build Steps&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Because I wasn't able to get the provided examples compiled (maybe because I didn't follow the correct procedure in STEP 2), I was looking to the differences and there are a few.&lt;BR /&gt;
&lt;BR /&gt;
The compilation of the resources needs some additional steps to be performed. When you look at the Project settings, you might notice the following additional "Custom Build" settings:&lt;BR /&gt;
&lt;BR /&gt;
"HelloWorld.grc"&lt;BR /&gt;
Description: "Compiling the localized GRC file..."&lt;BR /&gt;
Commands: (this depends on where you installed the DevKit)&lt;BR /&gt;
"C:\PROGRA~1\GRAPHI~1\APIDEV~1\Support\Tools\Win\ResConv.exe" -m r -D WINDOWS -T W -i RINT\HelloWorld.grc -o Debug\HelloWorld.grc.rc2 -D DEBUVERS"&lt;BR /&gt;
Outputs:&lt;BR /&gt;
"Debug\HelloWorld.grc.rc2"&lt;BR /&gt;
&lt;BR /&gt;
"HelloWorld.rc2"&lt;BR /&gt;
Description: "Compiling the RC2 file..."&lt;BR /&gt;
Commands: (this depends on where you installed the DevKit)&lt;BR /&gt;
"rc /i "C:\PROGRA~1\GRAPHI~1\APIDEV~1\Support\Inc" /i "C:\PROGRA~1\GRAPHI~1\APIDEV~1\Support\Modules\DGLib" /i Debug /d "DEBUVERS" /foDebug\HelloWorld.res RFIX.WIN\HelloWorld.rc2"&lt;BR /&gt;
Outputs:&lt;BR /&gt;
"Debug\HelloWorld.res"&lt;BR /&gt;
&lt;BR /&gt;
"HelloWorldFix.grc"&lt;BR /&gt;
Description: "Compiling the non-localized GRC file..."&lt;BR /&gt;
Commands: (this depends on where you installed the DevKit)&lt;BR /&gt;
"C:\PROGRA~1\GRAPHI~1\APIDEV~1\Support\Tools\Win\ResConv.exe" -m r -D WINDOWS -T W -i RFIX\HelloWorldFix.grc -p RFIX\Images -o Debug\HelloWorldFix.grc.rc2 -D DEBUVERS"&lt;BR /&gt;
Outputs:&lt;BR /&gt;
"Debug\HelloWorldFix.grc.rc2"&lt;BR /&gt;
&lt;BR /&gt;
What these steps do is obvious: translating a non-platform-specific resource file into a platform-dependent resource file. Rather clever, but a bit complex.&lt;BR /&gt;
&lt;BR /&gt;
A final step I like to do is directly copying the final compiled APX-file to the ArchiCAD-folder. This can be done in a Post-Build step:&lt;BR /&gt;
"XCOPY $(TargetPath) "C:\Program Files\ArchiCAD 8.1\Goodies\" /Y"&lt;BR /&gt;
&lt;BR /&gt;
Adapt it to where ArchiCAD is installed.</description>
      <pubDate>Wed, 16 Jun 2004 12:17:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72259#M7734</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-16T12:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72260#M7735</link>
      <description>&lt;B&gt;STEP 4 : running ArchiCAD &amp;amp; testing the plugin&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
This is easy. Load ArchiCAD, go to Tools &amp;gt; Add-On Manager and point to the newly created plugin: "Search for more Add-Ons..."&lt;BR /&gt;
&lt;BR /&gt;
It'll be displayed as "API DevKit Sample" unless you modified the "HelloWorld.grc" file. Now you know why you should do this &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;
Watch out! If you have two Add-ons with the same ID, it won't load. Therefore you need to use the Add-On Management tool to generate unique ID's.&lt;BR /&gt;
&lt;BR /&gt;
The sample does nothing... We don't have Hello World program yet!!!&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;STEP 5 : Finally making a Hello World program&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Add the following code into CommandHandler function in the file "HelloWorld.cpp":
&lt;PRE&gt;GSErrCode __ACENV_CALL	CommandHandler (const API_MenuParams * /*params*/)
{
	ACAPI_WriteReport ("Hello World", true);
	return NoError;
}		// CommandHandler ()&lt;/PRE&gt;

In ArchiCAD unload and reload your plugin and go to the newly entered menu Tools &amp;gt; Sample Menu&lt;BR /&gt;
&lt;BR /&gt;
A warning dialog will be displayed with the famous "Hello World" text.&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/10672i58DC0CB060C72863/image-size/large?v=v2&amp;amp;px=999" border="0" alt="x - hello world.jpg" title="x - hello world.jpg" /&gt;</description>
      <pubDate>Wed, 16 Jun 2004 12:31:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72260#M7735</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-16T12:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72261#M7736</link>
      <description>Now you should be able to try and follow along and then use the examples as reference with you.&lt;BR /&gt;
&lt;BR /&gt;
The examples seem to all use the same "APICommon.c" and "APICommon.h" files with some useful helper functions. I included them in my add-on and had to replace "APIEnvir.h" in "APICommon.c" with "HelloWorld.hpp" at the first line so it was using my includes.</description>
      <pubDate>Wed, 16 Jun 2004 12:53:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72261#M7736</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-16T12:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72262#M7737</link>
      <description>Thanks for all the answers, and special thanx to stefan for his step-by-step guide &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; &lt;BR /&gt;
 &lt;BR /&gt;
I'll work through it and see if it works the same way on the mac. &lt;BR /&gt;
 &lt;BR /&gt;
I think one of the problems is really to recognize what goes where. I mean several of the examples have, in additions to the specific addon.cpp-file, several other files like CIOStub.cpp. Those starting with APISomething I guess I shouldn't bother with, but what is the logic to what goes where, or the recommendation? &lt;BR /&gt;
 &lt;BR /&gt;
And then I wonder, an addon must include CheckEnvironment(), RegisterInterface(), Initialize() and FreeData(). But then I read about the inout module, and it said that initialization and uninitialization of Location must happen inside the main() - where do I put that, and are there more things that happen in a predefined order than the beforemensioned functions? Maybe its all to be found in the documentation, but I have been reading a lot of it, and things kind of blur... &lt;BR /&gt;
 &lt;BR /&gt;
I'm thinking of how to expand 'hello world' to explain other functions, would it be possible to read the message from a file, and log that it has been done to another file? Would it be possible to have the 'hello' appear on the plan as a textblock or maybe written by walls? - or have a pallette show up that you have to click to get the greeting? &lt;BR /&gt;
 &lt;BR /&gt;
Is it possible to interact with the database through a webbrowser using sql and a service on a webserver? &lt;BR /&gt;
 &lt;BR /&gt;
--  &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tor Jørgen</description>
      <pubDate>Wed, 16 Jun 2004 13:27:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72262#M7737</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-06-16T13:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72263#M7738</link>
      <description>&lt;BLOCKQUOTE&gt;Tor wrote:&lt;BR /&gt;I'll work through it and see if it works the same way on the mac.&lt;/BLOCKQUOTE&gt;
The process is largely the same on the Mac - the biggest differences boil down to the IDEs (CodeWarrior vs VC++). However, compiling the .grc files is much easier on the Mac. Make sure the GRC compiler and preference panels are installed in the relevant CodeWarrior plugin folders. With these installed, CodeWarrior will automatically compile the .grc files with the same simplicity as the .c/.cpp/.r files.&lt;BR /&gt;
 
&lt;BLOCKQUOTE&gt;Tor wrote:&lt;BR /&gt;I think one of the problems is really to recognize what goes where. I mean several of the examples have, in additions to the specific addon.cpp-file, several other files like CIOStub.cpp. Those starting with APISomething I guess I shouldn't bother with, but what is the logic to what goes where, or the recommendation?&lt;/BLOCKQUOTE&gt;
If you start with the example projects, you won't have to worry about this to start with. All the examples include CodeWarrior project files (.mwp), so you can be up and running quickly. As others have mentioned, you need to fill in your MDID resources to ensure the add-on will be loaded by ArchiCAD.&lt;BR /&gt;
&lt;BR /&gt;
Files included in the project like "ACAP_STAT.lib", "DGImp.lib", etc. are library files which directly or indirectly link the functionality of the ArchiCAD API into your add-on.&lt;BR /&gt;
&lt;BR /&gt;
You will also see CarbonLib, which is linking your add-on to Mac OS functionality. And finally, there should be C/C++ runtime libraries. I use the MSL libraries, but there is a subtle trap here. ArchiCAD add-ons must have a special compiler option set - Enums always Int - which automatically sets the size of all enumerator values to 2 bytes. Data structures in the API must be compiled this way in order for your add-on to calculate the offsets and length of the binary data in the same way as ArchiCAD. However, the standard C/C++ libraries provided with CodeWarrior have not been compiled with this option set by default, so you must build alternate versions of the libraries to use with the ArchiCAD API.  If you don't, it can result in some dreadful internal inconsistencies. Let me know if you don't know how to rebuild the MSL libraries.&lt;BR /&gt;
 
&lt;BLOCKQUOTE&gt;Tor wrote:&lt;BR /&gt;And then I wonder, an addon must include CheckEnvironment(), RegisterInterface(), Initialize() and FreeData(). But then I read about the inout module, and it said that initialization and uninitialization of Location must happen inside the main() - where do I put that, and are there more things that happen in a predefined order than the beforemensioned functions?&lt;/BLOCKQUOTE&gt;
Again, use the example projects as your guide. They will no doubt demonstrate most of the functionality you intend to use. Most of the initialisation is concerned with informing ArchiCAD of the services and requirements of your add-on.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;Tor wrote:&lt;BR /&gt;Is it possible to interact with the database through a webbrowser using sql and a service on a webserver?&lt;/BLOCKQUOTE&gt;
To an extent, you can interact with external services by whatever protocol you wish. For example, the GBS Energy add-on we developed for GeoPraxis interacts with their server via SOAP calls. The primary limitation is that your add-on must instigate all the communication - ArchiCAD will not invoke your add-on at the request of an external service.</description>
      <pubDate>Wed, 16 Jun 2004 22:02:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72263#M7738</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2004-06-16T22:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72264#M7739</link>
      <description>&lt;BLOCKQUOTE&gt;vannassen wrote:&lt;BR /&gt;Thanks for all the answers, and special thanx to stefan for his step-by-step guide &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; &lt;BR /&gt;
 &lt;BR /&gt;
I'll work through it and see if it works the same way on the mac. [...] &lt;BR /&gt;
--  &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tor Jørgen&lt;/BLOCKQUOTE&gt;
Don't forget to mail the differences back to this thread. That way, it can be a reference for others.&lt;BR /&gt;
&lt;BR /&gt;
I am still hoping that some more experienced developers can take a quick peak at the step-by-step and see it there are things that are done completely wrong (or at least, that should have been done in a different way). They are not wrong enough to not get it working &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;</description>
      <pubDate>Thu, 17 Jun 2004 07:14:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72264#M7739</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-17T07:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72265#M7740</link>
      <description>I've followed Stefans guide and done the following:&lt;BR /&gt;
&lt;BR /&gt;
I've started from scratch using the IDE of CodeWarrior which resulted in the standard framework with sourcefiles, libraries and stuff, and I've copied my ID's to the .grc-file under the MDID section.&lt;BR /&gt;
&lt;BR /&gt;
In the RegisterInterface() I've included this line
&lt;PRE&gt;GSErrCode errorCode = ACAPI_Register_Menu (32500, 32520, MenuCode_Tools, MenuFlag_Default);&lt;/PRE&gt;
In the Initialize() I've included this line
&lt;PRE&gt;GSErrCode errorCode = ACAPI_Install_MenuHandler (32500, CommandHandler);&lt;/PRE&gt;
Then I've copied the CommandHandler-function from Stefans code
&lt;PRE&gt;GSErrCode __ACENV_CALL	CommandHandler (const API_MenuParams * /*params*/)
{
	ACAPI_WriteReport ("Hello World", true);
	return NoError;
}		// CommandHandler ()&lt;/PRE&gt;
It compiled without trouble but when I registered it in ArchiCAD nothing showed up...&lt;BR /&gt;
&lt;BR /&gt;
Then I included these lines in the .grc file
&lt;PRE&gt;'STR#' 32500 "Menu strings" {
/*[ 1] */			"Hello World"
}

'STR#' 32501 "Strings for the Menu" {
/* [  1] */			"Hello World"
}&lt;/PRE&gt;
I've now got a menu, but when I click it nothing shows up...&lt;BR /&gt;
What's missing?&lt;BR /&gt;
-- &lt;BR /&gt;
Regards,&lt;BR /&gt;
Tor Jørgen</description>
      <pubDate>Thu, 17 Jun 2004 17:57:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72265#M7740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-06-17T17:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72266#M7741</link>
      <description>&lt;BLOCKQUOTE&gt;vannassen wrote:&lt;BR /&gt;Then I included these lines in the .grc file
&lt;PRE&gt;'STR#' 32500 "Menu strings" {
/*[ 1] */			"Hello World"
}

'STR#' 32501 "Strings for the Menu" {
/* [  1] */			"Hello World"
}&lt;/PRE&gt;
I've now got a menu, but when I click it nothing shows up...&lt;BR /&gt;
What's missing?&lt;BR /&gt;
-- &lt;BR /&gt;
Regards,&lt;BR /&gt;
Tor Jørgen&lt;/BLOCKQUOTE&gt;
Try to replace 32501 with 32520 in the second STR-resource.&lt;BR /&gt;
&lt;BR /&gt;
And try to unload and remove your add-on, close the Add-On Manager. Re-open it and reload it. And if possible, try to modify the settings for the Add-on so it's placed in the Extra-menu and not the Tools-menu. That way, you're absolutely sure that the meny will be generated all over again.&lt;BR /&gt;
&lt;BR /&gt;
When changing menu's, I had it happen a few times that the menu in ArchiCAD was not changing, although I had the impression that the code was modified.</description>
      <pubDate>Fri, 18 Jun 2004 07:39:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72266#M7741</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-18T07:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72267#M7742</link>
      <description>I should have looked up the ACAPI_WriteReport function a little  bit earlier  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_redface.gif" style="display : inline;" /&gt; - it writes to the reportwindow which I didn't view...&lt;BR /&gt;
It has been working for a while...&lt;BR /&gt;
I took away the 32520 string in the resouce, can't see that it did anything.&lt;BR /&gt;
&lt;BR /&gt;
But the main thing is: I've got the 'Hello World' up and running thanx to you!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;&lt;BR /&gt;
-- &lt;BR /&gt;
Regards,&lt;BR /&gt;
Tor Jørgen</description>
      <pubDate>Fri, 18 Jun 2004 08:44:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72267#M7742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-06-18T08:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72268#M7743</link>
      <description>ACAPI_WriteReport("Hello World", &lt;B&gt;true&lt;/B&gt;) should also display a message box.</description>
      <pubDate>Fri, 18 Jun 2004 08:56:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72268#M7743</guid>
      <dc:creator>stefan</dc:creator>
      <dc:date>2004-06-18T08:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72269#M7744</link>
      <description>I've tried both &lt;B&gt;true&lt;/B&gt; and &lt;B&gt;false&lt;/B&gt;, but it behaves the same.&lt;BR /&gt;
Wonder why...&lt;BR /&gt;
-- &lt;BR /&gt;
Regards,&lt;BR /&gt;
Tor Jørgen</description>
      <pubDate>Fri, 18 Jun 2004 09:24:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72269#M7744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-06-18T09:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72270#M7745</link>
      <description>Something add&lt;BR /&gt;
A personal icona in menu &lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;'STR#' 32500 "Menu strings" {
/* [  1] */		"Test ^32500"
}
.......

'GBMP'	32500	"Testico" {
	"Testico"
}
&lt;/PRE&gt;

Icon is Testico.bmp 16x16 &lt;BR /&gt;
I am added to the \RFIX\images according to instruction, it malfunction&lt;BR /&gt;
after added to the \Debug  already compiled errorless</description>
      <pubDate>Fri, 18 Jun 2004 09:56:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72270#M7745</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-06-18T09:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: [newbie] how about 'hello world'</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72271#M7746</link>
      <description>&lt;BLOCKQUOTE&gt;vannassen wrote:&lt;BR /&gt;I've tried both &lt;B&gt;true&lt;/B&gt; and &lt;B&gt;false&lt;/B&gt;, but it behaves the same.&lt;BR /&gt;
Wonder why...&lt;BR /&gt;
-- &lt;BR /&gt;
Regards,&lt;BR /&gt;
Tor Jørgen&lt;/BLOCKQUOTE&gt;

The behavior of ACAPI_WriteReport depends on the "Write Report" switch in Imaging and Calculation preferences. If that one is off, then the dialog won't appear even if you pass true in the second parameter. If you want an alert box which appears in every case, use DGAlert, DGResAlert, or DGResAlertParam.&lt;BR /&gt;
&lt;BR /&gt;
Good luck,&lt;BR /&gt;
&lt;BR /&gt;
Akos</description>
      <pubDate>Sat, 19 Jun 2004 10:11:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/newbie-how-about-hello-world/m-p/72271#M7746</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2004-06-19T10:11:35Z</dc:date>
    </item>
  </channel>
</rss>

