×
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 component members
2

Loop over component members

Loop over component members

(OP)
Hallo everybody,
Is it possible to perform a loop over the nodes or the elements of a selected component?

Thanks,

andrea

-------------------------------------------
 Andrea Mordini, Civil Engineer, Ph.D.           
 http://www.andreamordini.com                          
-------------------------------------------

RE: Loop over component members

Absolutely.  Just make sure those nodes are not part of the selected component or set when looping through your *do loop.  You may have to define a special component for this particular operation.

-Brian

RE: Loop over component members

Hi,

Of course it is possible. I'm not sure if I understand wright what you mean but I'll give it a try:

CODE


nd=ndnext(0)
*dowhile,nd
 ! do something
 nd=ndnext(nd)
*enddo

Regards,
Alex

RE: Loop over component members

(OP)
I am sorry, I did not get it. I have one component and I want to loop over its nodes. How can I do it?

andrea

-------------------------------------------
 Andrea Mordini, Civil Engineer, Ph.D.           
 http://www.andreamordini.com                          
-------------------------------------------

RE: Loop over component members

Okay I misunderstood you initial question.  Here is another snippit of code that is a little more indepth to help emphasize the point Alex is trying to make.

asel,,,,temp1
nsla,,1
*get,_nnode,node,,count
*get,_nmin,node,,num,min

*do,ii,1,_nnode
  nsel,,,,_nmin
  asel,,,,temp2
  nsla,,1
  _nslave=nnear(_nmin)
  nsel,none
  nsel,,,,_nmin
  nsel,a,,,_nslave
  cp,next,all,all
  asel,,,,temp1
  nsla,,1
  _nmin=ndnext(_nmin)
  *enddo
  
_nnode=
_nmin=
_nslav=

This is a macro I use for coupling two adjacent regions by definining area components, temp1 and temp2.

-Brian

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