How to send arguments to SpaceClaim executed in batch with a script?
Valérie Gelbgras
Member, Employee Posts: 157
✭✭✭✭
Could we send arguments to be used in a script when we launch SpaceClaim in batch?
Tagged:
2
Answers
-
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.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.L = float(args[0]) R = float(args[1]) path = args[2]
9 -
To get the list of the arguments, open a prompt command and enter "C:\Program Files\ANSYS Inc\v211\SCDM\SpaceClaim.exe" /?
1