Help Creating a script file /scripting
- Peter halverson
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
17 years 1 month ago #1814
by Peter halverson
Help Creating a script file /scripting was created by Peter halverson
I'm used to doing the majority of my fea work using the inbuilt scripting language of the program (e.g. a .inp file in ansys). It appears that salome will allow me to import a python script but I'm not sure how to write the script. Does anyone know where I can find documention? Or does anyone have a simple script that will create a few points, lines, areas, and volumes?
Peter
Peter
- Peter halverson
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
17 years 4 weeks ago #1821
by Peter halverson
Replied by Peter halverson on topic Re:Help Creating a script file /scripting
So to answer my own question: There are some example scripts at www.salome-platform.org/UserSection/salome_use/.
To make a vertex first you need to import the appropriate libraries
import salome
import geompy
#Then you can start creating
point1=geompy.MakeVertex(x,y,z)
k1=geompy.addToStudy(point1,'Name of Point1')
Now that seems like a lot of work compared to ansys's k,1,x,y,z For a point. As a result I hope to make an Ansys to Salome script translator. I'll use python.
To make a vertex first you need to import the appropriate libraries
import salome
import geompy
#Then you can start creating
point1=geompy.MakeVertex(x,y,z)
k1=geompy.addToStudy(point1,'Name of Point1')
Now that seems like a lot of work compared to ansys's k,1,x,y,z For a point. As a result I hope to make an Ansys to Salome script translator. I'll use python.
Moderators: catux
Time to create page: 0.199 seconds