This is known as parametric design (but c.f., conversational CAM below).
I’ve been exploring it using OpenSCAD and pairing that w/ METAPOST to make projects:
and also doing designs using BlockSCAD:
and it’s more-or-less the subject of my Kickstarter (which I’m running behind on, but hope to finish up this year):
https://www.kickstarter.com/projects/designinto3d/design-into-3d-a-book-of-customizable-project-desi
Other tools which offer this sort of parametric design include:
- Autodesk Fusion360
- Rhino3D w/ Grasshopper
- CADquery — stand-alone tool or an (outdated?) workbench in FreeCAD
I tried doing it in Alibre Atom3D, but found not being able to center things problematic:
https://community.carbide3d.com/t/parametric-design-using-alibre-atom3d/17409
List at: https://wiki.shapeoko.com/index.php/Programming
If there were a scripting language which could directly make .c2d files (which are JSON format) I’d be in business.
As an alternative, for simpler projects there’s also conversational CAM:
https://wiki.shapeoko.com/index.php/Interactive_G-Code_Generators
which is more in-line w/ what you’re asking after.