HYRCAN
User guide
×
Menu
Index
Introduction
 
This section gives an example of using a Python program to interact with HYRCAN. First we import the hyrcan and module with the import statement. The hyrcan module defines the interaction between Python and HYRCAN. We import the hyrcan module as the shortened name hy. The it.command (hyrcan.command) function is used to issue a series of HYRCAN commands.
 
Example:
These commands issues bunch of javascript commands. The triple quotes can also be used to define a multi-line string.
 
import hyrcan as hy
 
hy.command("newmodel()")
hy.command("set("failureDir","r2l")")
hy.command("extboundary(20,25,30,25,50,35,70,35,70,20,20,20,20,25)")
hy.command("""
matboundary(30,25,50,29,54,31,70,31)
matboundary(40,27,52,24,70,24)
definemat("ground","matID",1,"matName","Soil 1","uw",19.5,"cohesion",0,"friction",38)
definemat("ground","matID",2,"matName","Soil 2","uw",19.5,"cohesion",5.3,"friction",23)
definemat("ground","matID",3,"matName","Soil 3","uw",19.5,"cohesion",7.2,"friction",20)
assignsoilmat("matid",1,"atpoint",53.5982,32.8461)
assignsoilmat("matid",2,"atpoint",56.9309,28.517)
assignsoilmat("matid",3,"atpoint",34.2547,22.0234)
definelimits("limit",20,36.665,"limit2",45,70)
set("Method","BishopSim","on","Method","JanbuSim","on","Method","Spencer","on")
compute()
""")
The help manual was created with Dr.Explain