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.
SOLVED!

EDU license serial number via AC API / GDL REQUEST

Hi,

 

For an EDU license the GDL REQUEST options "program_info" and "Configuration_Number" return keySerialNumber=0 and empty string for "stConfigurationNumber". I assume the AC API does the same thing ( https://archicadapi.graphisoft.com/documentation/apienv_protectiondataid) Unfortunately I can't confirm that right now.

 

Is there another way to get the EDU serial number in the API and/or GDL?

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com
18 REPLIES 18

 


@easyDoesIt wrote:

Seems to me having this option would provide a good basis for developers to produce objects that are locked to a keySerial with a certain number of licenses without having to maintain a license management add-on nor ask users to install a add-on. Simpler the better!


I'm not quite sure what you mean by this.

You can already lock to a particular license number (not EDU), and if that license is a multiple network license, your GDL object will be available for all of those network licenses.

 

As far as I know allowing a single or network license is exactly the same.

If your check matches the allowed license number, then all is good.

 

I don't think you can pick and choose to say allow it for only 5 out of the 10 network licenses if that is what you are trying to do.

It is all or nothing as far as I know.

 

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Thanks Barry. I was thinking more to lock the license to a key with a maximum number of users, any number under the maximum is ok.

 

So if the object allowed maximum 5 users yet the key had 10 network licenses attached then it would not match and be locked out.

 

If the object allowed maximum 5 users yet the key had say 3 (or 5) network licenses then it this is ok and object will function.

 

Basically, it is trying to stop users purchasing a object for a select number of users on the same key when they actually have more.

Cheers,
Mark
Brisbane, Australia

I see.

I am not sure if there is a GDL command to find the number of licenses attached to a key.

As far as I know, you can only detect the license number being used by Archicad.

You are not actually interacting with the actual license key.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

This is a question that I accidentally read the article.
Did you lock GDL using API C++?

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.

AC27 on window 11

I haven't done it but there would be several possibilities that I can think of:

1. An C++ Add-On can have a BuiltIn Library for the Add-On. You could allow only users with certain license keys to place/manipulate objects from this builtin library. Those objects don't show up as "normal" objects as far as I know. You have to provide a way to even create them.

2. You can change parameters of objects with an Add-On. So with this you could lock an object by setting e.g. a flag in the object.

There are probably several further possibilities. It depends on what you actually want to achieve. Some things like getting AC key identification can be done directly in GDL as well.

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com

I don't understand the first explanation.
Can I ask for a more detailed explanation?
And what part of the api can I understand by studying?
It would be really nice if it was in the sample file.

 

In the case of number 2, I don't know if I misunderstood, but it seems that it is possible to change it by deploying and executing the api, is that correct?

AC27 on window 11

Generally you should check the following: APIEnv_ProtectionDataID


1. For BuiltInLibrary parts you should check the commands ACAPI_Register_BuiltInLibrary and APIAny_​GetBuiltInLibpartUnIdID.

One related example in the SDK is called 'LibPart_Test', but it doesn't directly deal with built in lib parts.

2. Yes you can change objects with the API. Also the above mentioned example 'LibPart_Test' has some code where the change the parameters of an object.


Also I want to highlight a third option: to directly lock an object in GDL. You can check the GDL Request option 'configuration_number'. It's less powerful but might be sufficient in a lot of situations.

 

I hope this helps a bit. The start with the C++ API can be tough. Unfortunately providing a working example is also quite a lot of work for which I can't invest the time right now.

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com

thank you so much.

I will study api c++ more and ask again.

 

You told me how to do this, but I can't find the function no matter how much I search. Is this a function you know?

This is something I can't find in apidevkit.chm either.
If so, where should I look for this function?

 

API_ParID paramId = ACAPI_Parameter_Create("MyParam", APIParBooleanType);

API_ParValue paramValue;
BNZeroMemory(&paramValue, sizeof(paramValue));
paramValue.boolValue = true; // set the parameter value to true
ACAPI_Parameter_SetValue(paramId, &paramValue, sizeof(paramValue));

 

Is there any way to lock GDL using API C++? - Graphisoft Community

 

AC27 on window 11

There is no single function in the API to achieve locking of GDL objects. I just generally described ideas of how it would work and what to study.

 

The code you mentioned includes functions that don't exist in the Archicad C++ API!

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com
Learn and get certified!