×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

loop over the node component/selected node, in which nodes numbers are not in sequence.
2

loop over the node component/selected node, in which nodes numbers are not in sequence.

loop over the node component/selected node, in which nodes numbers are not in sequence.

(OP)
Hello, everybody

Is it possible to loop over the node component or the selected node numbers, in which nodes number are not in sequence.

Thank you a lot

wind

RE: loop over the node component/selected node, in which nodes numbers are not in sequence.

Use the NXTH function from *GET. Your script may look something like:

CODE -->

nsel,s,node,,.......             ! select the node set
*get,currn,node,0,num,min        ! get minimum node num in variable currn
*get,num_of_nodes,node,0,count   ! get num of nodes

! Create a loop to carry out some function such 
! as finding the nodal x co-ordinate

*do,J,1,num_of_nodes
         ncx = nx(currn)      
	*get,currn,node,currn,nxth   ! Get the node number in the set higher than currn
	node = currn
*enddo 


------------
See FAQ569-1083: Asking questions the smart way on Eng-Tips fora for details on how to make best use of Eng-Tips.com

RE: loop over the node component/selected node, in which nodes numbers are not in sequence.

You can also use currn = ndnext(currn) instead of the *get,currn,node,currn,nxth

RE: loop over the node component/selected node, in which nodes numbers are not in sequence.

(OP)

*get,nmax,node,platei,count
*get,minno,node,platei,num,min

*dim,p1node,,nmax

n0=minno
p1node(1)=n0

*do,i,2,nmax
n0=ndnext(n0)
p1node(i)=n0
*enddo

*do,in,1,nmax ! start loop over all nodes in one plate
*get,xno,node,p1node(in),loc,x
*get,yno,node,p1node(in),loc,y
*get,zno,node,p1node(in),loc,z


dz = wopl*(b1*sin(pi*(xno-0)/a)+b3*sin(3*(xno-0)*pi/a))*sin(pi*(yno+375)/b)
n,p1node(in),xno,yno,zno+dz

*end do

RE: loop over the node component/selected node, in which nodes numbers are not in sequence.

(OP)
Drej and Orel, Thank you two.

I combined what you two said, and write the above code, it works.

many thanks to you two.

cheers

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources