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!

*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.

Jobs

How to put all elements one by one to named selection by apdl?

How to put all elements one by one to named selection by apdl?

(OP)
If someone can do it in apdl, please tell me the command script.
Thank you very much.

RE: How to put all elements one by one to named selection by apdl?

What is your exact requirement or goal?

Do you want to select all elements together or individually and assign named selection to each? You can use named selection with scoping method=worksheet to achieve both options.



RE: How to put all elements one by one to named selection by apdl?

(OP)
Thank you for your Kind reply.
Actually I want to select individually and assign named selection to each.
And I want to do it with one click or speedy way.

Can you explain scoping method?
Thank you very much.

RE: How to put all elements one by one to named selection by apdl?

You have not answered my question-What is your exact requirement or goal? Another question is why you want select elements individually and assign named selection to each? This will require as many no of named selection as there are no of elements. This is not required unless there is strict requirement.

You cannot do it in one click. You need to do it by hard way by assigning values of element ID in worksheet. At least I do not know any good straight forward way to achieve this. Scoping method is where you achieve selection by actually selecting or by providing parameters in worksheet. For example following snap shows selection of element with id no 1 using worksheet as scoping method. So now if you have some thousand elements you need to create thousand named selections by each time changing the element id no for each new named selection.


RE: How to put all elements one by one to named selection by apdl?

Probably something like this would work:

ecount=elmiqr(0,13)
cm,elements,elem

*do,enum,1,ecount
*get,enummin,elem,0,num,min
esel,s,elem,,enummin
cm,elem%enum%,elem
cmsel,s,elements
esel,u,elem,,enummin
cm,elements,elem
*enddo



Rick Fischer
Principal Engineer
Argonne National Laboratory

RE: How to put all elements one by one to named selection by apdl?

Thank you Mr Rick. You have given very efficient way to generate the components.
I was thinking in same line to use *do and *enddo loop. But stuck with how to change the name of component. This seems to be easy way. I am not hardcore user of APDL anyway.

Your macro works excellently in the Ansys APDL but not in Workbench Mechanical using command snippet beacause component and named selection are not same thing for both environments. One need to adopt hard way as I described in earlier post for workbench, I guess. What do you feel?

Please could you suggest some good resources for learning APDL command for APDL and workbench. Do you Automate by using scripting language in workbench? If yes please provide any good resources to start.

RE: How to put all elements one by one to named selection by apdl?

Components and named selections are exactly the same thing in WB and MAPDL. Remember that WB is just a front end for MAPDL, and WB writes an APDL script. The trick is to pick the correct entity to make into a named selection. For instance, if you select a face of a cube meshed with brick elements, you get a named selection that is comprised of nodes. If you pick a face of a surface body, your named selection will be comprised of shell elements.

You can still make it work even if your named selection has the wrong entities. For instance, if you want the nodes on the face of surface body, make the face a named selection. You should get elements in your named selection. Then in MAPDL:

cmsel,s,named_selection
nsle,s,1
cm,named_selection,node

Rick Fischer
Principal Engineer
Argonne National Laboratory

RE: How to put all elements one by one to named selection by apdl?

I think I am not clear about what I said by- component and named selection are not same thing for both environments.

What I really mean is-Ansys APDL treats named selection of WB as component and WB writes out information in terms of element and nodal information but not geometry. IMHO WB never treats components of APDL as named selection since it write information neither in terms of geometry nor in terms of element/nodes. WB simply ignore the component related command and never return information in form of named selection.

If both are same then why above commands are not working and resulting in workbench as named selection in the form of elements.

RE: How to put all elements one by one to named selection by apdl?

Yes, if you create a component in MAPDL, WB does not recognize it.

Rick Fischer
Principal Engineer
Argonne National Laboratory

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


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close