Could we send arguments to be used in a script when we launch SpaceClaim in batch?
We can run Spaceclaim in batch with the command below.
"C:/Program Files/ANSYS Inc/v202/scdm/spaceclaim.exe" /Headless=False /Splash=False /Welcome=False /RunScript="C:\Documents\StackOverFlow\demoArguments.py" /ScriptArgs="1,2,c:\test\demoArguments.scdoc" /ScriptAPI=19 /ExitAfterScript=True
We need to provide the path of the script to run with /RunScript="...". Arguments are passed with /ScriptArgs="1,2,c:\test\demoArguments.scdoc". It could be useful to indicate the path of a file to open or where to save the file before closing Spaceclaim.
/RunScript="..."
/ScriptArgs="1,2,c:\test\demoArguments.scdoc"
In the script, we get the arguments from args. args is a list of string. To get a dimension such a length or a radius, we need to use float() to get a number.
float()
L = float(args[0]) R = float(args[1]) path = args[2]
To get the list of the arguments, open a prompt command and enter "C:\Program Files\ANSYS Inc\v211\SCDM\SpaceClaim.exe" /?