CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > ANSA

HELP on scripting

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2019, 08:26
Post HELP on scripting
  #1
New Member
 
Kcm
Join Date: Feb 2019
Posts: 4
Rep Power: 7
Kcm155 is on a distinguished road
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
Kcm155 is offline   Reply With Quote

Old   March 8, 2019, 05:40
Default
  #2
New Member
 
Kcm
Join Date: Feb 2019
Posts: 4
Rep Power: 7
Kcm155 is on a distinguished road
hello,
is anybody here!
Kcm155 is offline   Reply With Quote

Old   March 21, 2019, 05:04
Default
  #3
New Member
 
Nguyễn Xuân Hồng Tâm
Join Date: Oct 2017
Posts: 1
Rep Power: 0
Monster20089 is on a distinguished road
can you show me form of your csv file, maybe i can help you
Monster20089 is offline   Reply With Quote

Old   March 21, 2019, 06:24
Default
  #4
New Member
 
Kcm
Join Date: Feb 2019
Posts: 4
Rep Power: 7
Kcm155 is on a distinguished road
Quote:
Originally Posted by Monster20089 View Post
can you show me form of your csv file, maybe i can help you
Hello Monster20089,
thank you for your reply
I have already found a solution for this problem

thanks
Kcm155 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 20:30.