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

Confusion about starting add-on development

Anonymous
Not applicable
Hi,

I've registered to the API platform in order to try and develop my own addon.
I am a bit familiar with coding such as HTML and a bit of JavaScript, but my C++ skills are unknown.

I've read through the basic explanations on:
http://archicadapi.graphisoft.com/api-reference

But sadly a lot of it is confusing to me, being a non-programmer.

The first thing that I would like to ask, is how to 'start' my add-on. The instructions say I need an 'MDID' resource in the form of:
'MDID' 32500 "Add-On Identifier" {
        developerID
        localID
    }
But I am not sure how to create this. Is any IDE sufficient? Do I specifically need a Visual Studio platform for this? What file type is this saved as?


Regarding the process in the link:
https://helpcenter.graphisoft.com/technotes/setup/software-technologies/getting-started-with-the-api...

the issue is the "AddOnAdmin". From what I can tell, this is just the add-on manager in ArchiCAD right? When I go to the add-on manager though, I have no option to make a "New Database" as they ask and insert my developer ID and so forth...


So right now I really want to start figuring out specifics of how and what to code for an add-on but I can't figure out the initial steps to start doing this.

I'm also a bit unclear about which file types the code needs to be saved as in general and if there is a specific folder structure within my addon folder that I need to respect.

I've marked all the questions in Bold and would be happy if someone knows how to answer any of them

Thank you!
29 REPLIES 29
Ralph Wessel
Mentor
Just use ordinary GDL – a GDL add-on is only needed in very exceptional circumstances. Then write an add-on using the general ARCHICAD API to populate and insert the object(s).
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Ralph wrote:
Just use ordinary GDL – a GDL add-on is only needed in very exceptional circumstances. Then write an add-on using the general ARCHICAD API to populate and insert the object(s).
Thanks a lot, it's helpful. But could you please provide me with a code snippet how to create a 3D point and render it on the scene.

Thanks
Ralph Wessel
Mentor
Take a look at the GDL reference guide for a start. That will explain all you need to know for scripting an object. It's up to you whether the object displays one point or many (or all points).

You can place an instance of this object through an add-on with ACAPI_Element_Create.

The parameters can be populated with one or more points with APIAny_​ChangeAParameterID.

The example projects provide good sample code for using these functions.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Ralph wrote:
Take a look at the GDL reference guide for a start. That will explain all you need to know for scripting an object. It's up to you whether the object displays one point or many (or all points).
Thanks Ralph. I found out that there is a possibility to import a point cloud from an external file. That flow is suitable for me but I need to use custom point cloud format not supported by Archicad.
Have I got it right that I have to create a GDL object from add on's code and then generate a LCF file? I tried to look into .lcf file and found that it's a GDL script with some binary data, isn't it?
In the GDL guide I found a 'POINTCLOUD' command, but it is not clear how one can use it. And what does it mean 'Point clouds are not displayed by the Internal 3D Engine'? It'a a quote from GDL Reference Guide P.155
What flow could you recommend me?

Thanks
Ralph Wessel
Mentor
I can't give detailed advice about point clouds because I haven't personally developed anything based on that technology. I suggest prototyping you workflow on a small scale to explore how these functions work and what the limitations might be. Someone from GS might be able to give more guidance.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
You seem to go more broadly than topic

Back to the yafimsky question:
Barry has right. It's hard to get started on GS API. However it's not impossible. I had several attpemts based on documentation and white paper. Recently I have found API Blog which solves all beginners mysteries. For the beginning I suggest two crucial posts by Akos and Tibor:

Here you will solve MDID mistery:
http://archicadapi.graphisoft.com/hello-world-part-2-dialog-with-text-svg-icon-and-button
Here you will solve VS2017 compiling issue:
http://archicadapi.graphisoft.com/working-in-visual-studio-2017
And helo word(this one didn't work for me but probably it was vs2017 problem)
http://archicadapi.graphisoft.com/hello-world

After those 3 post, you should be able to compile examples form API.
Please keep up with those blogs written as a coherent tutorial with each step described it way easier to understand than learning from docs.


Back to the cloud point what kind of file format are you trying to use?
Anonymous
Not applicable
kzaremba wrote:

Back to the cloud point what kind of file format are you trying to use?

We are trying to import custom point cloud format. The question is if it's possible to create abstract point cloud in the scene using GDL objects (the array of points of range 100 K~1 million).

Is it correct that we have to create a GDL object from add on's code, then generate a LCF file and import it?
In the GDL guide there is topic about point cloud and single command 'POINTCLOUD'. But it's not fully clear how to use it in our case. Also what does it mean: "Point clouds are not displayed by the Internal 3D Engine."? (http://gdl.graphisoft.com/reference-guide/point-clouds)

or maybe there is another solution?

Any help would be very appreciated.
Anonymous
Not applicable
I'm not an expert but the topic is interesting so I did some reading:

It seems that GDL POINTCLOUD uses two standard extensions - xyz and e57:
https://helpcenter.graphisoft.com/guides/archicad-21/archicad-21-reference-guide/interoperability/fi...

So It seems you have right. If you have some custom format you shall translate your format via addon first and then create GDL based on POINCLOUD command. It doesn't seem like the best way to do it in terms of performance.

Note there are some limitations because .lfc's max size:
https://helpcenter.graphisoft.com/troubleshooting/3d-modeling/archicad-19-point-cloud-troubleshootin...
Anonymous
Not applicable
Thanks for your reply and helpful links. We'll try GDL objects creating and see the performance.
Anonymous
Not applicable
Thank very much for your kind.
kzaremba wrote:
Back to the yafimsky question:
Barry has right. It's hard to get started on GS API. However it's not impossible. I had several attpemts based on documentation and white paper. Recently I have found API Blog which solves all beginners mysteries. For the beginning I suggest two crucial posts by Akos and Tibor:

Here you will solve MDID mistery:
http://archicadapi.graphisoft.com/hello-world-part-2-dialog-with-text-svg-icon-and-button
Here you will solve VS2017 compiling issue:
http://archicadapi.graphisoft.com/working-in-visual-studio-2017
And helo word(this one didn't work for me but probably it was vs2017 problem)
http://archicadapi.graphisoft.com/hello-world

After those 3 post, you should be able to compile examples form API.
Please keep up with those blogs written as a coherent tutorial with each step described it way easier to understand than learning from docs.