×
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

Deleting a set of nodes from another set of nodes

Deleting a set of nodes from another set of nodes

Deleting a set of nodes from another set of nodes

(OP)
Hi,

I have a problem with two sets of nodes (huge number of nodes). One set cointains all the nodes, and the second one contains only a group of nodes. I need to create a thrid one set, which would be: ALL NODES - SECOND SET OF NODES.

One option would be to go one by one, in the set that contains all the nodes and deleting the number node that I don't want there, but as it is a huge number of node, this is tedious and also I can make mistakes.

Does anyone know if I can do this in a more simplified way? For instance,

NSET,NSET=ALL
NSET,NSET=GROUP2

¿NSET,NSET=ALL-GROUP2?

Thank you very much!

RE: Deleting a set of nodes from another set of nodes

use python, write a macro or use the interactive command line

all=[node1,node2,...,nodeN]
group2=[grnode1,grnode2, ..., grnodeN]
for i in group2:
ind=all.index(i)
all.pop(ind)
print('no thanks')

Use the .rpy file to easily see how you can access and save the nodelists, or look into the scripting manual.

RE: Deleting a set of nodes from another set of nodes

(OP)
Thank you sdebock, I don't know how to use python. I think I should learn it.

Finally, what I did was to do it in Matlab, and it worked well also.

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