In the past few months I've fielded a few questions re: whether or not ASE will work with specific versions of Civil 3D. In others words, can ASE read and write to the Aecc alignments, surfaces, profiles, etc.?
When answering I could only verify compatibility with the versions I've actually used for development, which included all releases up to and including 2020 at the time.
However, I discovered clients had been using ASE with newer versions of Civil 3D that I hadn't installed yet. I wondered "... Hmmm… How did I do that?..."
Then, today while working on the next ASE update, I encountered the real answer to my question:
Jeff Mishler gets the credit for that one. He created an algorithm which handles installed version detection and AEC library selection with grace.
Anyone familiar with Visual Lisp & ActiveX will understand the code in the image and see why it works so elegantly. Basically, the algorithm presets the correct C3D library reference based on the version of AutoCAD you're running. The info you need is all stored right there in the registry. You just have to know where to look.
In the image, see the specifications in the header of the function for additional information.