Tools like Fusion360 and FreeCAD have python scripting. You can definitely programmatically create entire models. But, because Fusion360 and FreeCAD are both parametric, you can also just define a number of parameters as global variables and then reference them in dimensions (with formulas). For KiCAD, I just export to STEP files (Fusion 360 has integrated physical and electrical design, but I found Fusion 360's electrical/PCB design to be worse than KiCAD).