Setting up several parts of an assembly with a single file, using a loop, and tables...?

Hello

I'm looking here for the best Solidworks tool to set up different parts of an assembly, and therefore of the assembly itself, let me explain:

I need to be able to:

1) Enter parameters (example: maximum load, length, width...)

2) Calculate new parameters depending on the input parameters, (example: calculate the diameter of a part as a function of width), using a "tant"/"While" loop (why? Because to calculate the height, the formulas are too complex, so I have to use a loop of this type: as long as "a condition", increment the height until I reach that condition. Example: As long as the "deformation of the part" is greater than 1mm, increase the height (and recalculate the deformation with the new height)...)

3) Depending on the input parameters and the configuration of the first part (height calculation...), go and find in a two-dimensional table (therefore depending on two parameters), the box that fits well, a box that corresponds to all a series of parameters that must be introduced into the solidworks assembly so that it modifies the size of the parts on its own

 

What I've already done:

1) Solution that works but a bit complicated: I created all my parts and assembly from global variables (all my parts have the same variables). I linked the global variables to a text document. I made a program (c language) that the user  has to run, the program asks for the input parameters, calculates the global variables and modifies the text file. When the text file is modified (and therefore the global variables), I just have to update the assembly and it takes the right dimensions.

2) Solution that doesn't work: On the same principle, all my parts/assemblies are made from global variables, I made an excel file that calculates these global variables according to the input variables (I did vba for the while loop), then I wanted to create a family of parts on my final assembly (in which there are global variables), hoping that by modifying the family of parts, it modifies the global variables of my assembly (there it works) and automatically, it modifies the global variables of all my parts (as it's the same variables as my assembly), and therefore that it puts the assembly back to the right dimensions (in the end only the global variables of the assembly move but the parts don't get to the right dimensions)

 

Thank you very much to the people who had the courage to read everything (hoping you understood everything)

Don't hesitate to ask me for screenshots or other information, or to explain more clearly

I hope you can help me

DSL for spelling mistakes