|
[Sponsors] |
February 20, 2019, 08:26 |
HELP on scripting
|
#1 |
New Member
Kcm
Join Date: Feb 2019
Posts: 4
Rep Power: 7 |
Hello ;
currently , i have some projects with ANSA, and i am trying to automate some operations using python, I wonder if you have some free script that I can use to fit my needs, and I'll be grateful if you have a script which can read coordinate from an xlsx file and generates SPRING (im working with Deck>PAMCRASH) you can find below the current script, till now i have succeeded to: - read & create POINTS from (csv) file - create NODES and SPRINGS from those nodes but i can't find the link between the two parts ( i need to convert the POINTS from csv file to NODES or Create PRINGS from POINTS directly) import ansa from ansa import * def main(): # import csv file and create POINTS file = 'C:/Users/ejjed/Desktop/Scripting/Test.csv' list_points = ansa.base.ImportCSVFileCreatePoints( file ) # create set-NODES vals = {'Name':'new set'} set = base.CreateEntity(constants.NASTRAN, "SET", vals) # create NODES nodes_list = [] for i in range(5): vals = { "X": i*50, "Y": i*50, "Z": i*50 } n = base.CreateEntity(constants.PAMCRASH, "NODE",vals) base.AddToSet(set, nodes_list) # create SPRING from NODES vals_property = {"IDPRT":111, "Name": "new property"} property =base.CreateEntity(constants.PAMCRASH,"PART_SPRING ",vals_property) vals_element = {"M":1,"IPART":111,"N1":1,"N2":5,} SpringEle = base.CreateEntity(constants.PAMCRASH, "SPRING",vals_element) cordially |
|
March 8, 2019, 05:40 |
|
#2 |
New Member
Kcm
Join Date: Feb 2019
Posts: 4
Rep Power: 7 |
hello,
is anybody here! |
|
March 21, 2019, 05:04 |
|
#3 |
New Member
Nguyễn Xuân Hồng Tâm
Join Date: Oct 2017
Posts: 1
Rep Power: 0 |
can you show me form of your csv file, maybe i can help you
|
|
March 21, 2019, 06:24 |
|
#4 |
New Member
Kcm
Join Date: Feb 2019
Posts: 4
Rep Power: 7 |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] ICEM Scripting Issues | tylerplowright | ANSYS Meshing & Geometry | 33 | September 27, 2021 16:35 |
[ANSYS Meshing] Need help with selection of edges using scripting | studentzz | ANSYS Meshing & Geometry | 1 | March 5, 2017 16:49 |
Glyph Scripting Origin | pdp.aero | Pointwise & Gridgen | 3 | July 9, 2015 16:57 |
record actions via scripting | Marabelle | ANSYS | 0 | July 31, 2013 11:57 |
[DesignModeler] change import by scripting | dragonwei | ANSYS Meshing & Geometry | 0 | September 17, 2012 05:08 |