2023-03-15 12:31 PM
Is there any way to lock GDL using API C++?
for example
1. When the api is executed, the cpu id is read, and if it is correct, a specific variable is created so that GDL can read this variable so that the value of GDL can be changed.
2. How to create a variable in the api c++ model view option so that GDL can read this variable and change the value of GDL if correct
It's not my opinion, it's a question I'm asking because I'm curious about how I can do it because someone told me that they are locking GDL using the api.
2023-03-15 08:19 PM
I asked AI and he said:
"It is not possible to "lock" GDL using the API in ARCHICAD. GDL is a programming language used to create parametric objects in ARCHICAD, and it can be freely modified by the user. The API provides a way to interact with ARCHICAD programmatically, but it does not provide a way to prevent the user from modifying GDL code.
That being said, it is possible to use the API to create custom parameters or variables that can be used by GDL scripts. For example, you could create a custom parameter that stores a value, and then read that value in a GDL script to modify the behavior of an object.
To create a custom parameter using the ARCHICAD API, you can use the ACAPI_Parameter_Create function. Here's an example of how you could create a custom parameter named "MyParam" that stores a Boolean value:
API_ParID paramId = ACAPI_Parameter_Create("MyParam", APIParBooleanType);
You can then set the value of the parameter using the ACAPI_Parameter_SetValue function:
API_ParValue paramValue;
BNZeroMemory(¶mValue, sizeof(paramValue));
paramValue.boolValue = true; // set the parameter value to true
ACAPI_Parameter_SetValue(paramId, ¶mValue, sizeof(paramValue));
In your GDL script, you can read the value of the parameter using the "Parameter" command:
Parameter("MyParam", MyParam)
The value of the "MyParam" variable in the GDL script will be set to the value of the "MyParam" custom parameter you created using the API.
Note that this approach does not "lock" GDL in any way, as the user can still modify the GDL code directly if they choose to do so. However, it does provide a way to create custom parameters that can be used to modify the behavior of objects created with GDL."
2023-03-16 03:13 AM - edited 2023-03-20 05:53 AM
The variable you are talking about is a variable within archicad.
That means you can call it from GDL.
thank you
2023-03-20 05:51 AM - edited 2023-03-20 05:52 AM
I'm trying to study ACAPI_Parameter_Create.
But which manual should I look at?
I couldn't find the function in apidevkit.chm.
It would be more appreciated if you could point me to a sample file.
2023-03-21 09:20 AM
All warning messages appear.
Are there any items that need to be included?
I would like to know the manual.
I can't find it no matter how much I look for it.
2023-03-24 01:23 PM
Those functions don't exist in the Archicad C++ API. @uisanata cited an answer from an AI which seems to have hallucinated the functions. The whole AI answer is incorrect in many different ways, I would completely disregard it in your case.