GDL
About building parametric objects with GDL.

GDL variant in c# programming

Anonymous
Not applicable
Hi,

Im using c# programming language.

I can get the parameters from parameters_of_objects table while i execute the query in archicad. While i use c# programming datareader to execute the same command(which is working in archicad environment), its not working, it throws an error. Becoz the parameter_value is a "GDLvariant"

Could anyone please tell me how to covert GDLvariant to string?

or

is there any other way to make use of GDLvariant in c# programming?
5 REPLIES 5
Karl Ottenstein
Moderator
Hi,

I've moved this question to the developer forum, since there is no C# interface to anything within ArchiCAD itself. In terms of the API, for any language other than C and C++ you are on your own. Perhaps someone has attempted to do some C# interfacing. Personally, C# being a Microsoft-invented and non-open language, I do not recommend that anyone even consider it.

Cheers,
Karl
One of the forum moderators
AC 28 USA and earlier   •   macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Anonymous
Not applicable
ok... then regardless of any language, there shud be a way to convert GDLvariant to string or to any other datatype, right ?

Can we convert GDLvariant to any other datatype?
Karl Ottenstein
Moderator
AFAIK, there is no variant parameter type accessed from the API when library parts (GDL) are accessed...

See API_AddParType for the struc/union and API_AddParID for the parameter type flag.

From your other thread (I assume it is you with a nearly identical userid?) about SQL, perhaps you are trying to automate a SQL query rather than program an add-on?

Or are you automating the query using an add-on and utilizing APIAny_ExecuteSQLQueryID and then attempting to process the resulting xml file?

Please state completely and clearly what you are attempting so that someone can help you.

Thanks,
Karl
One of the forum moderators
AC 28 USA and earlier   •   macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Anonymous
Not applicable
Hi,

Thanks for ur reply. yes, it was me who posted tat thread with the name vidhyaravichandar(since somehow i cudnt access this account. Here onwards i will be using only this id) sorry for any inconvinenence...

Coming to my question,

Actually, im not using API and not processing xml file.
Outside Archicad, using ODBC connection, im trying to do listing. Im reading the pla file, to get the parameter value which is GDL variant and use it in my application. I tried a sql query inside archicad to get a GDL variant, it is working fine. Now in my application, i need to get this GDL variant. But i cudnt do tat, since i dont know how to convert this GDLvariant to any other datatype...

if my info is not sufficient for u, plz let me know...

Can u plz help me to know how to convert GDLvariant to any other datatype? is it not possible to convert? Do u have any idea to do so?


Thank u for ur time n consideration
Karl Ottenstein
Moderator
See this discussion:

http://archicad-talk.graphisoft.com/viewtopic.php?t=26969

Sorry that there is nothing easy there.

Karl
One of the forum moderators
AC 28 USA and earlier   •   macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB