Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

qsdurant

Mechanical
Nov 28, 2016
2
If someone can do it in apdl, please tell me the command script.
Thank you very much.
 
Replies continue below

Recommended for you

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.



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

Named_selection_kpme6m.png
 
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
 
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.
 
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
 
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.
 
Yes, if you create a component in MAPDL, WB does not recognize it.

Rick Fischer
Principal Engineer
Argonne National Laboratory
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor