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

GS::GenerateHashValue and update from API 24 to API 25

MudratDetector
Enthusiast

I think I understand the concepts of my solution, just not the exact C++ details.  Or maybe my thoughts are completely off base...

 

A former colleague created an information window in 24 that docks into our Archicad interface.  This window displays results from one of our custom APIs.

 

This is the code for 25 that should provide a "unique GUID to construct the palette to make it dockable".

 

MudratDetector_0-1642458136866.png

 

When I build the 24 code for 25, I get an error.  I am using VS2019.

error C2672: 'GS::GenerateHashValue': no matching overloaded function found

 

This snippet is the same exact code from our 24 version of the tool that works.  Except for 2 things:

 

1.  The 25 version of the code has +3 overloads for GS::GenerateHashValue.  The 24 version of the same code has +19 overloads for GS::GenerateHashValue, one of which must work when GS::Guid is passed to it.  And is not available in 25.  The error log from the build mentions each of the 3 overload definitions that were tried and failed when passing a GS::Guid with the error

could not deduce template argument for 'const GS::Range<TYPE> &' from 'const GS::Guid'

could not deduce template argument for 'const GS::Optional<Type> &' from 'const GS::Guid'

could not deduce template argument for 'const GS::OptionalOnHeap<Type> &' from 'const GS::Guid'

 

I have tried to create a 4th overload (in the corresponding .hpp file) that accepts GS::Guid but cannot seem to do that correctly.  I looked at the 19 overloads from 24 and could not find one that specifically mentions a GS::Guid being passed or jumped out at me as "the one".

 

2.  The GS::Guid might have to be different???  I do not know where this came from - Is it made up and follows the correct string format?  Is it generated from a previously existing window made only to capture a guid for later creation by this API?

 

I feel like I am on the right track.  Any direction on this would be appreciated.

 

Thank - chris

Chris Gilmer
Intel i9-12950HX CPU @ 2.30GHz, 16 cores
NVIDIA GeForce RTX 3080
48.0 GB RAM
Windows 10 Pro 64-bit
2 REPLIES 2
Akos Somorjai
Graphisoft
Graphisoft

Hi Chris,

 

There was a slight (undocumented 😢 ) change in the interface. Here's what we use now internally:

const GS::Guid paletteGuid ("{ED83CB58-B5C9-11DF-AEF0-1531E0D72085}");
const Int32 paletteRefId = (Int32) GS::CalculateHashValue (paletteGuid);

Hope this helps, Akos

Akos -

Thanks for shining some light on this one!

The undocumented hints are beyond helpful.

 

- chris

Chris Gilmer
Intel i9-12950HX CPU @ 2.30GHz, 16 cores
NVIDIA GeForce RTX 3080
48.0 GB RAM
Windows 10 Pro 64-bit