2004-06-15 07:45 PM - last edited on 2023-08-07 12:21 PM by Doreena Deng
Looking at the PDF link that you posted, I think you're in for some "fun", Tor Jørgen! Welcome!I'm glad for the welcome, but I worry that maybe I'm in over my head - I guess thats where the fun starts...
2004-06-16 03:27 PM
2004-06-17 12:02 AM
Tor wrote: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.
I'll work through it and see if it works the same way on the mac.
Tor wrote: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.
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?
Tor wrote: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.
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?
Tor wrote: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.
Is it possible to interact with the database through a webbrowser using sql and a service on a webserver?
2004-06-17 09:14 AM
vannassen wrote:Don't forget to mail the differences back to this thread. That way, it can be a reference for others.
Thanks for all the answers, and special thanx to stefan for his step-by-step guide
I'll work through it and see if it works the same way on the mac. [...]
--
Regards,
Tor Jørgen
2004-06-17 07:57 PM
GSErrCode errorCode = ACAPI_Register_Menu (32500, 32520, MenuCode_Tools, MenuFlag_Default);In the Initialize() I've included this line
GSErrCode errorCode = ACAPI_Install_MenuHandler (32500, CommandHandler);Then I've copied the CommandHandler-function from Stefans code
GSErrCode __ACENV_CALL CommandHandler (const API_MenuParams * /*params*/) { ACAPI_WriteReport ("Hello World", true); return NoError; } // CommandHandler ()It compiled without trouble but when I registered it in ArchiCAD nothing showed up...
'STR#' 32500 "Menu strings" { /*[ 1] */ "Hello World" } 'STR#' 32501 "Strings for the Menu" { /* [ 1] */ "Hello World" }I've now got a menu, but when I click it nothing shows up...
2004-06-18 09:39 AM
vannassen wrote:Try to replace 32501 with 32520 in the second STR-resource.
Then I included these lines in the .grc file'STR#' 32500 "Menu strings" { /*[ 1] */ "Hello World" } 'STR#' 32501 "Strings for the Menu" { /* [ 1] */ "Hello World" }I've now got a menu, but when I click it nothing shows up...
What's missing?
--
Regards,
Tor Jørgen
2004-06-18 10:44 AM
2004-06-18 10:56 AM
2004-06-18 11:24 AM
2004-06-18 11:56 AM
'STR#' 32500 "Menu strings" { /* [ 1] */ "Test ^32500" } ....... 'GBMP' 32500 "Testico" { "Testico" }Icon is Testico.bmp 16x16
2004-06-19 12:11 PM
vannassen wrote: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.
I've tried both true and false, but it behaves the same.
Wonder why...
--
Regards,
Tor Jørgen