Loss of variables when exporting to .dat file

Im trying to export this crosssection made with module aqua so that I can edit it via a Python script and make it run for a range of profile heights and widths. However when i export the teddy file to .dat, all the variables used in the coordinates of my cross section get lost and instead they get a fixed value. Therefore I cannot just change one value to change the cross section in python. Does anyone have a solution for this?
This is my teddy file before export:

+PROG AQUA urs:4 $ Cross Sections
HEAD Sections
PAGE UNII 6
CTRL REST 13
SECT 22 MNO 3 TITL ‘MAIN PROFILE’

sto#H 1900
sto#B 190
sto#tw 9.4
sto#tf 14.6
sto#r 21

SPT ‘OM’ 0 -0.5*#H MNO 0
SPT ‘UM’ 0 0.5*#H MNO 0

POLY TYPE O
VERT ‘P1’ 0.5*#B 0 REFP ‘OM’
VERT ‘P2’ 0.5*#B #tf REFP ‘OM’
VERT ‘P3’ 0.5*#tw #tf REFP ‘OM’ R #r TYPE TP
VERT ‘P13’ 0.5*#tw 0
VERT ‘P4’ 0.5*#tw -#tf REFP ‘UM’ R #r TYPE TP
VERT ‘P5’ 0.5*#B -#tf REFP ‘UM’
VERT ‘P6’ 0.5*#B 0 REFP ‘UM’
VERT ‘P7’ -0.5*#B 0 REFP ‘UM’
VERT ‘P8’ -0.5*#B -#tf REFP ‘UM’
VERT ‘P9’ -0.5*#tw -#tf REFP ‘UM’ R #r TYPE TP
VERT ‘P14’ -0.5*#tw 0
VERT ‘P10’ -0.5*#tw #tf REFP ‘OM’ R #r TYPE TP
VERT ‘P11’ -0.5*#B #tf REFP ‘OM’
VERT ‘P12’ -0.5*#B 0 REFP ‘OM’
VERT ‘P1’ 0.5*#B 0 REFP ‘OM’
END

and this is what it becomes after exporting:

SECT 22 MNO 3 MRF 0 BTYP BEAM TITL “MAIN PROFILE” LTAU 9000
SPT ‘OM’ Y 0 Z -950 MNO 0
SPT ‘UM’ Y 0 Z 950 MNO 0
POLY TYPE O MNO 3
VERT ‘P1’ Y 95 Z -950 EXP 1 REFP ‘@OM
VERT ‘P2’ Y 95 Z -935.4000 EXP 1 REFP ‘@OM
VERT ‘P3’ Y 4.700000 Z -935.4000 R 21 TYPE OTP EXP 1 REFP ‘@OM
VERT ‘P13’ Y 4.700000 Z 0 EXP 1
VERT ‘P4’ Y 4.700000 Z 935.4000 R 21 TYPE OTP EXP 1 REFP ‘@UM
VERT ‘P5’ Y 95 Z 935.4000 EXP 1 REFP ‘@UM
VERT ‘P6’ Y 95 Z 950 EXP 1 REFP ‘@UM
VERT ‘P7’ Y -95 Z 950 EXP 1 REFP ‘@UM
VERT ‘P8’ Y -95 Z 935.4000 EXP 1 REFP ‘@UM
VERT ‘P9’ Y -4.700000 Z 935.4000 R 21 TYPE OTP EXP 1 REFP ‘@UM
VERT ‘P14’ Y -4.700000 Z 0 EXP 1
VERT ‘P10’ Y -4.700000 Z -935.4000 R 21 TYPE OTP EXP 1 REFP ‘@OM
VERT ‘P11’ Y -95 Z -935.4000 EXP 1 REFP ‘@OM
VERT ‘P12’ Y -95 Z -950 EXP 1 REFP ‘@OM
VERT ‘P1’ Y 95 Z -950 EXP 1 REFP ‘@OM
END

Hi,

I think you need to look at your problem differently, because when you export the database, you export the calculation done to put it in the form of Teddy code.

Whereas in your case you only want the SSD calculation parameters and not the calculation results, so you need to think differently!

If I’ve understood correctly, you want to do something automatic, where Python directly modifies the variables you’ve created to define the geometry of the cross-section.

I’ve done the same thing, but with VBA where I’ve created a teddy script with variables and I’ve used a VBA code that runs through the script and modifies the variables in teddy according to the data it enters in advance in Excel.

I don’t know if you’re looking for the same logic, but what’s certain is that launching the calculations and then exporting them means exporting the calculations, which means losing your variables!

Thats indeed what I am trying to do.
I was hoping I could write a python script to change for example change the variable ‘H’ and as a result have a different cross section.
But i guess i have to go at it differently as you suggested.

Thanks for your help!

If you’re going to interact with sofistik via scripting, you should skip ssd.
Use pure teddy instead (dat files).

If you want to interact via python or command line, you can make use of environment variables:

  • Use Sto#H $(height) in the file
  • Define height as a environment variable in the command line (or python)
  • Calculate the file using sps.exe (batch version of the calculation tool)

Now you can start looping, changing the height for each loop.