If you run the Variability Platform as you have it setup, you can go to the output and click on the red triangle next to "Variability Chart" and select
Save By-Group Script=>Script Window
and it will create the script you need.
Variability Chart( Y( :measured_value ), X( :part_num ), BY( :test_num ) );
However, you mention Spec Limits, but in your Variability Chart specification, has no ability to handle Spec Limits.
So what I am saying, is that I think there are additional requirement that you may have for the output you want.
If not, the above script is what you need.
Jim