TAGGED: get-command, mechanical-apdl, nodes, plot-results, pyansys
May 12, 2022 at 7:28 amtim.hertingerSubscriber
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.hertingerSubscriberAdditionally: 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.
May 25, 2022 at 12:49 pmMike RifeAnsys 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
May 25, 2022 at 1:39 pmChandra SekaranAnsys 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
Ansys Innovation Space
- You must be logged in to reply to this topic.
Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.Trending discussions
- how to improve the inflation quality at sharp corners?
- ANSYS Workbench Measuring within Design
- check element type
- The mesh file exporter could not resolve cyclic dependencies in overlapping contact regions error
- Meshing Error
- How to resolve Mesh Failure
- Conformal vs Non-Conformal Mesh
- Error in meshing
- execution error inside the mesher. The process suffered an unhandled exception or ran out of memory
- inflation created stairstep mesh at some location
Top Rated Tags
© 2023 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.