Using Python to translate NASTRAN .brd inputs to APDL inputs
Converting data from one format to another is a perfect use of Python. Python is quite good at reading, writing and finding things in text files. This allows us to develop tools that can be used to find data in NASTRAN inputs files and create the ANSYS APDL equivalent. There might be faster tools, but for ease of creating readable code that others can use and adapt, it is hard to beat Python.
No comma has all lines ending without commas so it had to be corrected. This was simply done by looping through the set_list and finding the next corresponding no_comma value in the no_comma list. That values gets written to the set_end list.
And for actual programmers, yes, there are probably a 1000 better ways to do this.
ansys apdl documentation link Then once the array parameter is complete, you loop through those nodes using the NSEL command to select them. Once the entire set is selected, you can create the component (name selection) using the CM command.
I include the APDL steps in one block because they need to be run that way. I just wrote the cm.inp file to my D drive and that can be imported in APDL (File - Read Input from…) after you have a Workbench generated APDL input file for the rest of the model.
And that is how you can get your SET selections from a .bdf file to an APDL input file.
Was this page helpful?