We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should mapdl.components retrieve all the components (selected or not)?
mapdl.components
Because it seems a reasonable thing to do this:
if "mycomp" in mapdl.components: print("exists")
The following APDL commands retrieves if a components exists or not. It does not matter its selection state.
*get,comp_bool, comp, name_component, type
from ansys.mapdl.core import launch_mapdl mapdl = launch_mapdl(start_instance=False, port=50052) mapdl.clear() out = mapdl.input("export_to_ansys.ays") print(mapdl.components) assert "GROUP1" not in mapdl.components assert "LAY_WK_ANC" not in mapdl.components assert "LAY_WK_SPRINGS" not in mapdl.components assert "LAY_WK_TRENCH1" in mapdl.components mapdl.aplot() print(mapdl.components) assert "GROUP1" not in mapdl.components assert "LAY_WK_ANC" not in mapdl.components assert "LAY_WK_SPRINGS" not in mapdl.components assert "LAY_WK_TRENCH1" in mapdl.components """ MAPDL Components ---------------- LAY_WK_TRENCH1 : AREA """ mapdl.cmsel("all") print(mapdl.components) assert "GROUP1" in mapdl.components assert "LAY_WK_ANC" in mapdl.components assert "LAY_WK_SPRINGS" in mapdl.components assert "LAY_WK_TRENCH1" in mapdl.components mapdl.cmsel("S", "LAY_WK_SPRINGS") print(mapdl.components) mapdl.cm("mycomponent", "nodes") mapdl.cmsel("None") if "mycomponent" in mapdl.components: print("Yes") else: print("No")
The text was updated successfully, but these errors were encountered:
I need to also allow to:
len(mapdl.components)
Sorry, something went wrong.
Idea to check:
mapdl.components: # get current components arr = mapdl.get_component_selection() # select all components mapdl.cmsel("all") # check/in/print whatever action print(mapdl.components) # Getting back previous selection mapdl.select_components(arr)
It might be a problem when after components selection, we have played around with entities, unselecting or selecting.
No branches or pull requests
Should
mapdl.components
retrieve all the components (selected or not)?Because it seems a reasonable thing to do this:
Tip
The following APDL commands retrieves if a components exists or not. It does not matter its selection state.
Example
The text was updated successfully, but these errors were encountered: