Skip to content
New issue

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

Plot command deletes component names (named selections/cm) #2452

Closed
4 tasks done
mcMunich opened this issue Oct 26, 2023 · 3 comments · Fixed by #2454
Closed
4 tasks done

Plot command deletes component names (named selections/cm) #2452

mcMunich opened this issue Oct 26, 2023 · 3 comments · Fixed by #2454

Comments

@mcMunich
Copy link
Contributor

🤓 Before submitting the issue

🔍 Description of the bug

I noticed that when I was doing some plotting in between some boolean actions, my component names were lost.

I have simplified the problem below. There are two cmlist commands, before and after a vplot. They are not the same but should be.

🕵️ Steps To Reproduce

from ansys.mapdl.core import launch_mapdl
import os

here = os.getcwd()
d = 1000
r = 250

mapdl = launch_mapdl(run_location=here,override=True,jobname = 'cmfail')

mapdl.prep7()

mapdl.block(x1=-3*d,x2=3*d,y1=-d/2,y2=d/2,z1=0,z2=d)
mapdl.cm(cname='BLOCK1',entity='VOLU')

mapdl.vsel('NONE')
mapdl.cyl4(xcenter = -d , ycenter = 0 , rad1 = r , depth = d)
mapdl.cm(cname = 'H1',entity='VOLU')

mapdl.allsel()
prePlotCMList = mapdl.cmlist()
mapdl.vplot(quality = 2)
postPlotCMList = mapdl.cmlist()

mapdl.exit()

💻 Which Operating System are you using?

Windows

🐍 Which Python version are you using?

3.11

📝 PyMAPDL Report

C:\spyderEnv\Lib\site-packages\pyvista\utilities_init_.py:69: PyVistaDeprecationWarning: The pyvista.utilities module has been deprecated. GPUInfo is now imported as: from pyvista.report import GPUInfo.
warnings.warn(

PyMAPDL Software and Environment Report

Packages Requirements


Core packages

ansys.mapdl.core : 0.67.0
numpy : 1.25.1
platformdirs : 3.8.1
scipy : 1.11.1
grpc : Package not found
ansys.api.mapdl.v0 : Package not found
ansys.mapdl.reader : 0.52.20
google.protobuf : Package not found

Optional packages

matplotlib : 3.7.2
pyvista : 0.42.3
pyiges : 0.3.1
tqdm : 4.65.0

Ansys Installation


Version Location

221 C:\Program Files\ANSYS Inc\v221
222 C:\Program Files\ANSYS Inc\v222
231 C:\Program Files\ANSYS Inc\v231
232 C:\Program Files\ANSYS Inc\v232
241 C:\Program Files\ANSYS Inc\v241

Ansys Environment Variables


ANSYS221_DIR C:\Program Files\ANSYS Inc\v221\ANSYS
ANSYS222_DIR C:\Program Files\ANSYS Inc\v222\ANSYS
ANSYS231_DIR C:\Program Files\ANSYS Inc\v231\ANSYS
ANSYS232_DIR C:\Program Files\ANSYS Inc\v232\ANSYS
ANSYS241_DIR C:\Program Files\ANSYS Inc\v241\ANSYS
ANSYSLIC_DIR C:\Program Files\ANSYS Inc\Shared Files\Licensing
AWP_LOCALE221 en-us
AWP_LOCALE222 en-us
AWP_LOCALE231 en-us
AWP_LOCALE232 en-us
AWP_LOCALE241 en-us
AWP_ROOT221 C:\Program Files\ANSYS Inc\v221
AWP_ROOT222 C:\Program Files\ANSYS Inc\v222
AWP_ROOT231 C:\Program Files\ANSYS Inc\v231
AWP_ROOT232 C:\Program Files\ANSYS Inc\v232
AWP_ROOT241 C:\Program Files\ANSYS Inc\v241
CADOE_LIBDIR221 C:\Program Files\ANSYS Inc\v221\CommonFiles\Language\en-us
CADOE_LIBDIR222 C:\Program Files\ANSYS Inc\v222\CommonFiles\Language\en-us
CADOE_LIBDIR231 C:\Program Files\ANSYS Inc\v231\CommonFiles\Language\en-us
CADOE_LIBDIR232 C:\Program Files\ANSYS Inc\v232\CommonFiles\Language\en-us
CADOE_LIBDIR241 C:\Program Files\ANSYS Inc\v241\CommonFiles\Language\en-us

📝 Installed packages

a

📝 Logger output file

b

@germa89
Copy link
Collaborator

germa89 commented Oct 26, 2023

Ok.. I find out the issue... because we do some component selections inside vplot... when you get out of that function, although you my have all the entities correctly selected (we take care of that) the components need to be selected.

I did notice similar behaviour here:
image

https://mapdl.docs.pyansys.com/version/stable/api/_autosummary/ansys.mapdl.core.component.ComponentManager.html#ansys.mapdl.core.component.ComponentManager

So the "solution" is to issue:

mapdl.cmsel("s", "H1")
mapdl.cmsel("s", "BLOCK1")

I do recognise it is not the desirable way for the things to work. I will come up with something.

@mcMunich
Copy link
Contributor Author

mcMunich commented Dec 6, 2023

It only seems to work if you S and then A:

`mapdl.cmsel("s", "H1")

mapdl.cmsel("a", "BLOCK1")`

@germa89
Copy link
Collaborator

germa89 commented Dec 7, 2023

It only seems to work if you S and then A:

`mapdl.cmsel("s", "H1")

mapdl.cmsel("a", "BLOCK1")`

@mcMunich Are you using the main branch in the repo? Because #2454 should fix this, but it hasn't been included in a release yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants