TAGGED: get-command, mechanical-apdl, nodes, plot-results, pyansys
-
-
May 12, 2022 at 7:28 am
tim.hertinger
SubscriberHi all,
I want to get the node numbers of a previously selected line. So it is necessary to get the whole numbers of nodes on the line to save it into an array or table (e.g.: 34, 56, 74, 34, ...).
So far I have selected the line and all the nodes on that line. Afterwards I used the GET.command to count the **** numbers, but that just gave me the absolute number of nodes on the line (e.g.: 16).
Im working with PyANSYS to run the MAPDL code, but that should not be a problem:
line=mapdl.lsel("S", "LINE", vmin=8) #Select line
node=mapdl.nsll("S", 1) #Select nodes on line
get= mapdl.get("N_COUNT","NODE", 0, "COUNT")
Hopefully you can help me with that topic :)
Thanks!
May 12, 2022 at 7:31 amtim.hertinger
SubscriberAdditionally: Thats the output while running the command
SELECTALL NODES (INTERIOR TO LINE, AND AT KEYPOINTS)
RELATED TO SELECTED LINE SET.
16NODES (OF26686DEFINED) SELECTED FROM
1 SELECTED LINES BY NSLL COMMAND.
SELECTFOR ITEM=LINE COMPONENT=
IN RANGE8 TO8 STEP1
1LINES (OF388DEFINED) SELECTED BY LSELCOMMAND.
16.0
May 25, 2022 at 12:49 pmmrife
Ansys EmployeeFirst you can ask this question on the PyMAPDL Github page - https://github.com/pyansys/pymapdl - in the Discussions.
Next, see the PyMAPDL documentation on the Mesh class. You can get a array of currently selected nodes with mesh.nnum. So in your case you could use this instead:
mapdl.lsel("S", "LINE", vmin=8)
mapdl.nsll node = mapdl.mesh.nnum
Mike
May 25, 2022 at 1:39 pmChandra Sekaran
Ansys EmployeeThe APDL commands would be:
lsel,s,line,,6 ! select,say, line ID 6
nsll,s,1 ! select all nodes on that line
*vget,nnum,node,1,nlist ! get a list of node IDs into array nnum.
! dimensions of nnum automatically defined by program
*stat,nnum(1) ! list node IDs in array nnum
Viewing 3 reply threads- The topic ‘Get node numbers of selected line’ is closed to new replies.
Innovation SpaceTrending discussionsTop Contributors-
4167
-
1487
-
1338
-
1188
-
1021
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-