BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Archicad C++ API
About Archicad add-on development using the C++ API.

How can I access my add-on from a GDL object via APPLICATION_QUERY (... ?

Anonymous
Not applicable
In GDL object I need to get any calculations from my add-on.
Can I write in GDL object any like this:

n = APPLICATION_QUERY ("My add-on name", "my_function",var1, var2)

and so on.
What I must write in my add-on for process this request?

Thanks for the answer .
8 REPLIES 8
Ralph Wessel
Mentor
Tsepov wrote:
In GDL object I need to get any calculations from my add-on.
Can I write in GDL object any like this:
n = APPLICATION_QUERY ("My add-on name", "my_function",var1, var2).
What I must write in my add-on for process this request?
You have to write a different kind of add-on (.GDX) with a separate dev-kit. Add-ons developed with the GDL dev-kit are very limited and can't interact with the project or communicate with other add-ons. We've developed some of these in the past, but trying to phase them out now because they're not very powerful and can be a support nightmare. We only have one left in active use.
Ralph Wessel BArch
Anonymous
Not applicable
It is very important to me to make it available the large-scale development of GDL libraries.
Can I do the following:
1. To call from the GDL element to my gdx application.
2. From gdx, to call my apx application (just like it is done between apx). To make there anything.

So, to get back in GDL element at least 1 or 0.

I compiled a file with an example reportGD64.
Put file
GDL IO Example.gdx
in the catalog ARCHICAD.
It seems ARCHICAD did not curse when loading.

Unfortunately I did not find an example gdl element to test the gdx example.
Ralph Wessel
Mentor
I don't believe this is supported. We've wanted to access API data from objects for quite some time, but there has been no (robust) method. The GDX development environment seems clearly designed for very specific circumstances, e.g. i/o, calculations etc., not general API functionality.
Ralph Wessel BArch
Anonymous
Not applicable
Now it is very important to find a solution.
The question is whether my users will use ARCHICAD or will they go to another platform (((.
I need to at least get to the call from the GDL to my function in C ++ in order simple to do large calculations quickly.

Now I am stuck on mastering the add-on from the ReportGD example in ARCHICAD 21.
The file "GDL IO Example.gdx" is obtained.
How to contact him from the GDL to see if it works at all or not?
How to catch in the Visual Studio debugger?

And further.
In the GDL directory where the ARCHICAD extensions are only few the gdx files.
Therefore, it is unlikely that the APPLICATION_QUERY command is processed with gdx.

n = APPLICATION_QUERY (extension_name, parameter_string, variable1, variable2, ...)

May be extention_name - is add-ons name apx?
Ralph Wessel
Mentor
Try using a request, e.g.
rrr = request("<name_of_gdx>", "<name_of_function>", receivedValue)
Although for an i/o GDX you might need to use open:
ch = open("<name_of_gdx>",  "<file_name>", "<parameters>"))
You can debug into a GDX just like any other kind of add-on, setting breakpoints etc.
Ralph Wessel BArch
Anonymous
Not applicable
I somehow dealt with the GDL addon, something I did, but in fact, apart from the functions described in the example, there is nothing in it and you will not be able to find out anything about the project.
Can help
1) The addon should simply be placed in the folder (... ArchiCAD ХХ \ extension ArchiCAD \ GDL) without any manipulations with the extension manager to inappropriately
2) Adon does not use the MDID '32500 resource, therefore there is no place to register the developer’s number or the Adon number.
3) Adon has its resource in the file ReportGD.RC the name that processes the GDL described in it in the last line (32 characters)

32500	ACNF
		BEGIN
			72,				0,		/* sizeof (ACNF)(4)	*/
			ACNF_VERSION,	0,		/* acnfVers     (4)	*/
			PlatformCode,	0,		/* platform     (4)	*/
			0,				0,		/* disableFlags (4)	*/
			IoGDLMethod,	0,		/* method		(4)	*/
			Vers_IoGDLMethod,		/* methodVers   (2)	*/
			0,						/* reserved     (2)	*/
			PersistentFunction,	0,	/* methodFlags  (4)	*/
			"date",					/* reserved     (4)	*/
			"offs",					/* reserved     (4)	*/
			"slen",					/* reserved     (4)	*/
			0,				0,		/*  0			(4) */
			"REPORT\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"	/* module name	(32)*/
		END

4) Therefore, in GDL, the basic example should be referred to as “REPORT”. Here is an example of my debugging master script, in the library element

dstr = "none"
val = 0
eggs="eggs-input"
spam="spam-input"
ch = OPEN ("REPORT", "spam-open", "eggs-open")
!n = INPUT (ch, eggs,spam,val)
n = INPUT (ch, 1,1, val)
OUTPUT ch, "spam-output", "eggs-output", "Hello World!"
CLOSE (ch)
hotspot2 0,0
text2 0,0,val
Anonymous
Not applicable
Ralph wrote:
Try using a request, e.g.
rrr = request("<name_of_gdx>", "<name_of_function>", receivedValue)
Although for an i/o GDX you might need to use open:
ch = open("<name_of_gdx>",  "<file_name>", "<parameters>"))
You can debug into a GDX just like any other kind of add-on, setting breakpoints etc.
Perhaps it would be necessary to put the text of the calling from the GDL in the documentation.
Otherwise, it is difficult to understand where starting. Especially when in the scalded cat mode, (how I'm in current situation).
It all worked.
And in principle, this is enough to move on.
Thank you so much for your support!)))
Anonymous
Not applicable
ufo_ru wrote:
32500 ACNF
BEGIN
72, 0, /* sizeof (ACNF)(4) */
ACNF_VERSION, 0, /* acnfVers (4) */
PlatformCode, 0, /* platform (4) */
0, 0, /* disableFlags (4) */
IoGDLMethod, 0, /* method (4) */
Vers_IoGDLMethod, /* methodVers (2) */
0, /* reserved (2) */
PersistentFunction, 0, /* methodFlags (4) */
"date", /* reserved (4) */
"offs", /* reserved (4) */
"slen", /* reserved (4) */
0, 0, /* 0 (4) */
"REPORT\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" /* module name (32)*/
END
Yes, the example module is really named "REPORT".
So that "<name_of_gdx>" is the "REPORT" in this case.
Thanks again!)
Learn and get certified!