The interest in fast and robust scenario design tools is increasing more and more in view of the operation of future large tokamaks like ITER. In fact, an efficient design procedure can reduce costs and risks, and, in particular, a well designed ramp-up can have a positive influence on the quality of the entire pulse. Large part of the ramp-up success is due to the way magnetic control acts, and in particular to the design of current waveforms in the active control coils. Model based intra-shot optimization tools have been proved to be useful for the magnetic design of plasma initiation and early ramp-up scenarios with recent experiments on TCV and MAST-U. These are based on the assumption that plasma is nearly circular and the focus is on the evolution of plasma current and position. The possibility to extend such procedures to design an entire ramp-up with a focus on shape evolution including X-point formation is the subject of this paper. The proposed algorithm is based on iterative learning control concepts. After a first model-based design obtained with classical tools, the scenario is corrected step by step solving a linearly constrained quadratic optimization problem which makes use of the results of previous experiments, rapidly converging to an optimal solution shot after shot. The procedure has been applied to MAST-U demonstrating advantages also on the plasma performance, and the possibility to implement it with a reasonable computational time to be used every time a new ramp-up is proposed or in the early operations of new or refurbished tokamaks.