Table include

Hi,
I am trying to define a table in a seperate teddy file like this (because I have a lot of lines)

cabl from=grp to type pa

    1          vx  -10085
    2          vx  -1047197.323
    3          vx  -1362600.09
    4          vx  -242299.611
    5          vx  -220208.0635
    6          vx  -219085.0965
    7          vx  -176701.5095
    8          vx  -128562.742
    9          vx  -102614.296
    10         vx  -64947.5735
    11         vx  -15310.289
    12         vx  -43432.5895
    13         vx  -80089.3145
    14         vx  -81416.717 

And add it in my main file using
cabl from=grp to type pa
#include filename.dat

But I get the following error
image

Thank you in advance for your help.

As far as i know #include works only with define blocks in the same file.
What i ussually do is to create a different dat file with the loads or prestressing or wathever, and then use +apply “filename.dat”.
In this way you can make order in very large files.

Thank you for your reply. However I still get the same error. Here is the code from the loading file.

+prog sofiload
head
lc 117 type none titl ‘cable prestress’
cabl from=grp to type pa

    1          vx  -10085
    2          vx  -1047197.323
    3          vx  -1362600.09
    4          vx  -242299.611
    5          vx  -220208.0635
    6          vx  -219085.0965
    7          vx  -176701.5095
    8          vx  -128562.742
    9          vx  -102614.296
    10         vx  -64947.5735
    11         vx  -15310.289
    12         vx  -43432.5895
    13         vx  -80089.3145
    14         vx  -81416.717   

end

and here is the code from the main file:

+prog sofiload

HEAD Definition of actions and loads
UNIT 5 $ units: sections in mm, geometry+loads in m
ECHO ACT Full
ACT G_1
ACT C

LC 200 TYPE NONE TITL ‘g1’ ; beam grp 0 TYPE pg pa 120
end
+apply tensions.dat

It seems you have errors in table definition.
fixed values must be at the end of the header line. Try with:
cable t pa from=grp type=vx
1 -10085
2 -1047197.323
etc…

also tensions.dat must be “tensions.dat” and be placed at the same dir unless specified.

thanks!

Is it possible to treat the tension.dat file as a list or variable and use specific elements as in “tensions.dat (1)” for the firts line for example?

You can use either (use “” if there are spaces):

  • +Apply filename.dat
  • #Include filename.dat
  • #include path/filename.dat

Difference:

  • +Apply file is read “when the calculation gets there” → you can change/update/generate the file in previous programs. However it needs to consist of “full programs” (e.g. template/ase/sofismhc/…)
  • "include file is read “when you push the calculation button” → can’t be altered during calculation run. Although you can just include snippets (e.g. include spt or cable in the middle of a sofimshc run)

With either one there is no read line by line.
Workaround:

  • Define an “include block” inside “include file”
  • Include the file
  • Include the block

E.g.

  • mainfile.dat:
    #include subfile.dat
    #include myblock
  • subfile.dat:
    #Define myblock

    #Enddef