2023-07-18 04:52 PM - last edited on 2024-07-10 03:11 PM by Aruzhan Ilaikova
Hey everyone!
I want to write a simple add-on on c++. I've downloaded necessities stated in https://github.com/GRAPHISOFT/archicad-addon-cmake and after going step-by-step through the docs I generated the c++ project, but it seems that I have some problems with including certain files like
Solved! Go to Solution.
2023-07-18 10:52 PM - edited 2023-07-18 10:53 PM
hoho oh man, youre in for a ride! 😄 so buckle up, once you get a hang of it, you will love the endless possibilitys of the api 😉
you need to get your start right. that means you need the following very important downloads before you can start:
- Dev Kit. You can get it here:
https://archicadapi.graphisoft.com/downloads/api-development-kit
start with the archicad 26 version
- Cmake ready Template:
https://github.com/GRAPHISOFT/archicad-addon-cmake
on the githup page there is a step-by-step guide how to get it running. best thing is if you know some cmake, makes it a lot easier to understand waht is going on. you allready did that but it did not work. im not to sure if vs code even works. the cmake template creates a visual studio solution, with the ending *.sln
i cant see the sln in your folder. so i have to assume that the cmake command never worked.
i suggest you use visual studio.
waht can help you very well to understand the api are the following steps:
1. compile, read and understand all the examples you find in the dev kit
they kinda suck, beacause they are so different in style and they are api testframework and example in one. but you learn a lot from those.
you want do create some properties? boom, "Property_Test" shows you how its done.
the compiling part is very important, look how those examples work live in archicad.
2. read the online documentation. go through the levels:
Level 1:
https://archicadapi.graphisoft.com/documentation/api-white-paper#api_reference_chapterlevel1
Level 2:
https://archicadapi.graphisoft.com/documentation/api-white-paper#api_reference_chapterlevel2
Level 3:
https://archicadapi.graphisoft.com/documentation/api-white-paper#api_reference_chapterlevel3
you dont need to read evrything, just the concepts to understand how the api works.
And last, and this is really the last resort. you can look in the offline help you downloaded in the dev kit. but that help is nicley said a catastrophe.
the descriptions are very unclear, cluttered and so on. the examples are way better to get your hands on the "how-to-do-things"
2023-07-18 11:13 PM
here is a little step by step guide with visual studio:
download the cmake template and the dev-kit from the links above.
1 start a empty visual studio:
2. Go to Open > cmake
3. choose your "CMakeLists.txt"
4. open the cmake file. if you want to run your plugin not only in the demo version you can add here your dev id and the loc id from your developer account
5. Open the Powershell and check if the directory is right. you must be where your cmake file ist
this is sometimes for no reason wrong on my machine.
6. now comes the most unfun part. you need to get your cmake command right
first part is the visual studio version. it has to be right. look at the pinned post when you work with visual studio 2022 and not 2019 waht you have to install
after that, its just where your dev kit is and which version it is
now youre ready to fire and you can press enter
7. when evrything went right, you should see the message "Build Files have been written to:"xxxx"
8. now you can close visual studio and open the visual studio solution:
9. when your newly created visual studio is open you can test out if evrything worked. for that you can build a plugin. for that click on "Add-on" and then "build"
10. In the output window visual studio should tell you that the build was succsessfull
11. Aaand here is the freshly created and ready to use Plugin-In
hope that helps a little bit 😃
2023-07-18 10:52 PM - edited 2023-07-18 10:53 PM
hoho oh man, youre in for a ride! 😄 so buckle up, once you get a hang of it, you will love the endless possibilitys of the api 😉
you need to get your start right. that means you need the following very important downloads before you can start:
- Dev Kit. You can get it here:
https://archicadapi.graphisoft.com/downloads/api-development-kit
start with the archicad 26 version
- Cmake ready Template:
https://github.com/GRAPHISOFT/archicad-addon-cmake
on the githup page there is a step-by-step guide how to get it running. best thing is if you know some cmake, makes it a lot easier to understand waht is going on. you allready did that but it did not work. im not to sure if vs code even works. the cmake template creates a visual studio solution, with the ending *.sln
i cant see the sln in your folder. so i have to assume that the cmake command never worked.
i suggest you use visual studio.
waht can help you very well to understand the api are the following steps:
1. compile, read and understand all the examples you find in the dev kit
they kinda suck, beacause they are so different in style and they are api testframework and example in one. but you learn a lot from those.
you want do create some properties? boom, "Property_Test" shows you how its done.
the compiling part is very important, look how those examples work live in archicad.
2. read the online documentation. go through the levels:
Level 1:
https://archicadapi.graphisoft.com/documentation/api-white-paper#api_reference_chapterlevel1
Level 2:
https://archicadapi.graphisoft.com/documentation/api-white-paper#api_reference_chapterlevel2
Level 3:
https://archicadapi.graphisoft.com/documentation/api-white-paper#api_reference_chapterlevel3
you dont need to read evrything, just the concepts to understand how the api works.
And last, and this is really the last resort. you can look in the offline help you downloaded in the dev kit. but that help is nicley said a catastrophe.
the descriptions are very unclear, cluttered and so on. the examples are way better to get your hands on the "how-to-do-things"
2023-07-18 11:13 PM
here is a little step by step guide with visual studio:
download the cmake template and the dev-kit from the links above.
1 start a empty visual studio:
2. Go to Open > cmake
3. choose your "CMakeLists.txt"
4. open the cmake file. if you want to run your plugin not only in the demo version you can add here your dev id and the loc id from your developer account
5. Open the Powershell and check if the directory is right. you must be where your cmake file ist
this is sometimes for no reason wrong on my machine.
6. now comes the most unfun part. you need to get your cmake command right
first part is the visual studio version. it has to be right. look at the pinned post when you work with visual studio 2022 and not 2019 waht you have to install
after that, its just where your dev kit is and which version it is
now youre ready to fire and you can press enter
7. when evrything went right, you should see the message "Build Files have been written to:"xxxx"
8. now you can close visual studio and open the visual studio solution:
9. when your newly created visual studio is open you can test out if evrything worked. for that you can build a plugin. for that click on "Add-on" and then "build"
10. In the output window visual studio should tell you that the build was succsessfull
11. Aaand here is the freshly created and ready to use Plugin-In
hope that helps a little bit 😃
2023-07-20 12:04 PM
Hey, Joel. Thanks for the information.
I've read the whole thread and got pretty good understanding of how it should be and yes, probably, I got something wrong with cmake. I'm using macOS so using visual studio for this one is pretty much impossible. Is there any information for macOS users(yep, I know that using macOS isn't the brightest idea of them all, haha)
Thanks in advance!
2023-07-20 01:24 PM - edited 2023-07-20 01:24 PM
after i wrote my post i thought: waht if he's a mac user? 😄
im sorry i cant help to far with XCode on a Mac. it is my understanding that you also need the dev kit. And the cmake create command also needs to be perfect. it could help if you show your cmake error messages.
furhtermore about developing on mac: im not to sure if this a bad idea, since most of archicad users i know are using a mac. so to be able to create and test a plugin in a environment that comes very close to the real deal isn't a bad idea at all. im thinking about to get a mac or at least a virtual machine to test my plugins on a mac.
2023-07-20 02:59 PM
Well, the good news is I found a windows pc and now I can do this one on windows.
Mac is convenient for many things, but since microsoft are so stubborn and dont want to share anything with macOS users, we have to improvise to survive haha.
Thanks for your help, ill try to implement everything above on my end. If anything goes south, I'll just return to this thread))
Have a great one!
2023-08-22 10:38 AM
Hi, Joel Buehler
In step 6, I got error like this. " Failed to detect Archicad version, please check the value of the AC_API_DEVKIT_DIR variable."
Can you help me fix it?
Thank you
2023-08-23 07:47 AM
hehey tranthanhlo, i think its just a error in the directory link. i just built an add-on and i had to add "\Support" to the directory uri.
should look something like this:
""C:\Program Files\API Development KIT 26.3000\Support"
does it work with an "Support"?