Well, you can’t extract solids directly using API in C3D 2022.
If you are able to upgrade I suggest at least 2023 as this is possible from version 2023.2:
As an alternative option, theoretically, if you create corridor sections you can use the SectionPoints Property to access section points and recreate shapes for Dynamo to loft solids.
https://help.autodesk.com/view/CIV3D/2025/ENU/?guid=ae047b27-4c49-e496-9486-6649e2228764
https://help.autodesk.com/view/CIV3D/2025/ENU/?guid=c19d4bb4-c946-9c3e-34f3-5c1a78903702
I have no idea how complicated this method would be, so if you really need this and you have access to newer versions I advise you to upgrade to 2023 or above.