How to use "mapdl.secread",File of.SECT,Runs successfully in ansys, But fails in python #1900
-
Python:3.8 Ansys:2021R1 Here is the python code: from ansys.mapdl.core import launch_mapdl
# start MAPDL and enter the pre-processing routine
mapdl = launch_mapdl()
mapdl.clear()
mapdl.prep7()
deck = 0.30
tside = 0.04
tmid = 0.02
widths = 1.5
widthm = 0.6
mapdl.et(1, "PLANE82")
mapdl.mp("EX", 1, 3.5E7)
mapdl.mp("PRXY", 1, 0.167)
mapdl.et(2, "BEAM189")
mapdl.mp("EX", 2, 2E8)
mapdl.mp("PRXY", 2, 0.3)
mapdl.rectng(-11, 11, -deck, 0)
mapdl.wpoffs(-10, 0)
mapdl.rectng(-widths/2, widths/2, -(deck+tside), 0)
mapdl.rectng(-tside/2, tside/2, -2.5, 0)
mapdl.rectng(-widths/2, widths/2, -2.5, -2.5+tside)
mapdl.asel("S", "LOC", "X", -11, -9)
mapdl.wpoffs(5, 0)
mapdl.rectng(-widthm/2, widthm/2, -(deck+tmid), 0)
mapdl.rectng(-tmid/2, tmid/2, -1.3, 0)
mapdl.rectng(-widthm/2, widthm/2, -1.3, -1.3+tmid)
mapdl.asel("S", "LOC", "X", -6, -4)
mapdl.wpave(0, 0, 0)
mapdl.asel("ALL")
mapdl.aptn("ALL")
mapdl.pnum("AREA", 1)
mapdl.numcmp("AREA")
mapdl.asel("S", "LOC", "Y", -deck, 0)
mapdl.aplot()
mapdl.aatt(1, "", 1)
mapdl.asel("INVE")
mapdl.aplot()
mapdl.aatt(2, "", 1)
mapdl.asel("ALL")
mapdl.aglue("ALL")
mapdl.aplot()
mapdl.esize(0.1)
mapdl.mshape(0, '2D')
mapdl.mshkey(1)
mapdl.amesh("ALL")
mapdl.nummrg("NODE", "", "", "", "LOW")
mapdl.secwrite("CFST", "SECT", 1)
mapdl.sectype(1, "BEAM", "MESH")
mapdl.secoffset("CENT")
mapdl.secread("CFST", "SECT", "MESH")
mapdl.asel("ALL")
mapdl.aclear("ALL")
mapdl.adele("ALL", "", "", 1)
mapdl.secplot(1,0)
mapdl.n(1, 0, 0, 0)
mapdl.n(2, 16, 0, 0)
mapdl.n(3, 32, 0, 0)
# Define one node for the orientation of the beam cross-section.
orient_node = mapdl.n(4, 8, 1)
# Print the list of the created nodes.
print(mapdl.nlist())
mapdl.et(3, "BEAM188")
mapdl.type(3)
mapdl.secnum(1)
mapdl.e(1, 2, orient_node)
mapdl.e(2, 3, orient_node)
# Print the list of the created elements.
print(mapdl.elist())
# Display elements with their nodes numbers.
mapdl.eplot(show_node_numbering=True, line_width=5, cpos="xy", font_size=40,vtk=False) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @bismarck1943 Do you happen to have a newer version of MAPDL installed? I tried this using 2022R2 and it works as expected. Just my luck that I do not have 2021 R1 installed. I can install to test if you have to use 21R1. Mike |
Beta Was this translation helpful? Give feedback.
Hi @bismarck1943 Do you happen to have a newer version of MAPDL installed? I tried this using 2022R2 and it works as expected. Just my luck that I do not have 2021 R1 installed. I can install to test if you have to use 21R1. Mike