Archicad C++ API
About Archicad add-on development using the C++ API.

Compile and create my own API in C++

Anonymous
Not applicable
Hi,

i'm Alex, from Spain. I need help about how to program API's for archiCAD, specifically how to compile C++ programs alredy finished with Qt GUI in Visual Studio and transform this project in an archiCAD API. I guess is something difficult but probably is not impossible. Please if somebody can help me or suggest me something different, please just contact with me here.

Thank you!
20 REPLIES 20
Ralph Wessel
Mentor
frankito5 wrote:
I need help about how to program API's for archiCAD, specifically how to compile C++ programs alredy finished with Qt GUI in Visual Studio and transform this project in an archiCAD API.
I haven't tried to do this, so I can only provide general advice. I suspect that you will have to rewrite the UI to use the ArchiCAD API rather than the Qt GUI. It will otherwise be very difficult - perhaps impossible - to integrate with ArchiCAD.

Also, be very careful with how resources (e.g. memory) are allocated by the Qt framework - a plugin cannot allocate resources with the same freedom as a standalone application.

And finally, be aware that the add-on only runs when ArchiCAD activates it, i.e. it cannot be running constantly on a separate thread.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
First of all, thank you for a quickly reply. I imagined something like that, but i thougt it was possible. I'm trying including the Qt files in a VS project and the oppossite, including into Qt project all the files remaining to the API. Unfortunately there are always mistakes about librarys or missing files.

Even i will continue trying i would like to know what is your expert suggestion. I'm working in an API that make some calculations but it must show a good appareance(e.g. EcoDesigner). I've compiled and i've taken a look to the examples from the API Developement kit and i runned them in archiCAD. But this appareance is not enough.

What can i do? Could you give me some references, tutorial about how to do it? Thank you again, your help will be really useful for me .
Ralph Wessel
Mentor
frankito5 wrote:
Even i will continue trying i would like to know what is your expert suggestion. I'm working in an API that make some calculations but it must show a good appareance(e.g. EcoDesigner). I've compiled and i've taken a look to the examples from the API Developement kit and i runned them in archiCAD. But this appareance is not enough. What can i do? Could you give me some references, tutorial about how to do it?
Information about the ArchiCAD API is very scarce, so there isn't really anywhere to look outside of the examples bundled with the developer kit.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
And what about give good appearance to the APIs? Thanks.
Ralph Wessel
Mentor
frankito5 wrote:
And what about give good appearance to the APIs? Thanks.
Your question is too broad - can you post some screenshots to illustrate the kind of UI features/tools you are aspiring to?
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Ok. I would like to start with little tasks. For example, imagine i want to get two numbers from the user and make a calculation(addition). I woud like to create a window where the user can introduce those numbers, press a button (calculate) and get another window with the addition result.
Ralph Wessel
Mentor
frankito5 wrote:
Ok. I would like to start with little tasks. For example, imagine i want to get two numbers from the user and make a calculation(addition). I woud like to create a window where the user can introduce those numbers, press a button (calculate) and get another window with the addition result.
This is very easy to accomplish using the ArchiCAD API - read the documentation for the Dialog Manager (in the DevKit) and look at the example called DG_Test. The API Dialog Manager can handle a wide variety of UI control types, including Check Box, Date & Time Control, Edit Control, Group Box, Icon, List Box, List View, Picture, Pop-up Control, Progress Bar, Push Button, Push Menu Control, Radio Button, Rich Edit Control, Scroll Bar, Separator Item, Slider Bar, Spin Control, Splitter Control, Static Text, Tab Control, Tree View, User Control, User Item. You can also create modal dialogs, modeless palettes, custom menus, and new panels within existing settings dialogs.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
I was reading the Dialog Manager just to make a new modal dialog in the DG_Test example. I've modified the GRF file just for make a new one with two buttons.

'GDLG' 32580 Modal 0 0 306 158 "Dialogo Prueba" {
/* [ 1] */ Button 10 128 70 20 LargePlain "Aceptar"
/* [ 2] */ Button 216 128 70 20 LargePlain "Cancelar"
}

'DLGH' 32580 DLG_32580_Profile_Controls {
1 "" Button_0
2 "" Button_1
}


Now its supossed i have to create the dialog, but i dont know how to do it. Its supossed i have to create a new window when i click in the name of my API and i have to give tasks to these bottons inside. I've read the manual and i've seen i have to use a "call function" and a DGModalDialog, right?
In this examples is not programmed like that. It has to be inside my new function in DG_Test.cpp? Could u give me an example for this two buttons?

I'm sorry, but i'm starting and when i learn how to do one, it will be easier to develop more and more. Thank you!
Anonymous
Not applicable
Good news!! I have my new dialog with two buttons in my API menu. So, dont text me and wait for my new answer. I hope it will be in few days . Thank you a lot!