Preprocessing

Preprocessing

Get node numbers of selected line

    • tim.hertinger
      Subscriber

      Hi 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!

    • tim.hertinger
      Subscriber
      Additionally: 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
    • Mike Rife
      Ansys Employee
      First 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
    • Chandra Sekaran
      Ansys Employee
      The 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
  • You must be logged in to reply to this topic.