Closed xiepei1 closed 3 years ago
Thanks for posting this. I'll try to have a fix for this later this week (been busy with other bugs at the moment).
Fixed in 9bbb053f07b749c7e9d53e860b0dea0000efd37d.
A bunch of these converted commands (like "/RGB,INDEX,100,100,100, 0"
) won't have the same sort of meaning if you mean to convert entirely to a pythonic script. In the next release there will be run_multiline
, (see #404), where you can just run a block of commands without having to convert it over. For example:
>>> cmd = '''/prep7
! Mat
MP,EX,1,200000
MP,NUXY,1,0.3
MP,DENS,1,7.85e-09
! Elements
et,1,186
et,2,154
! Geometry
BLC4,0,0,1000,100,10
! Mesh
esize,5
vmesh,all
nsel,s,loc,x,0
d,all,all
nsel,s,loc,x,999,1001
type,2
esurf
esel,s,type,,2
nsle
sfe,all,3,pres,,-10
allsel
/solu
antype,0
solve
/post1
set,last
plnsol,u,sum
'''
>>> resp = mapdl.run_multiline(cmd)
>>> resp
MATERIAL 1 EX = 200000.0
MATERIAL 1 NUXY = 0.3000000
MATERIAL 1 DENS = 0.7850000E-08
ELEMENT TYPE 1 IS SOLID186 3-D 20-NODE STRUCTURAL SOLID
KEYOPT( 1- 6)= 0 0 0 0 0 0
KEYOPT( 7-12)= 0 0 0 0 0 0
KEYOPT(13-18)= 0 0 0 0 0 0
output continues...
Also, you can run an input file using mapdl.input
:
Load a simple ``"ds.dat"`` input file generated from Ansys
Workbench.
>>> output = mapdl.input('ds.dat')
Regardless, I've also fixed the script converter for anyone who uses this in the future. Will be out in the next release 0.58.8
.
Seemingly, there is a bug in script translation function 'ansys.mapdl.core.convert_script()'
ansys.mapdl-core version 0.58.4
The example in User Guide is with version 0.57.0, seemingly looking okay in that version?
for example: i need to convert following APDL script which is in file 'coordinates.mac'
with conversion code:
get result:
We can see clearly that starting from line3, there is a problem there.
The rest seems working fine...