diff --git a/doc/changelog.d/3753.fixed.md b/doc/changelog.d/3753.fixed.md new file mode 100644 index 0000000000..139da30292 --- /dev/null +++ b/doc/changelog.d/3753.fixed.md @@ -0,0 +1 @@ +fix: Bug located in VSEL using KSWP field \ No newline at end of file diff --git a/src/ansys/mapdl/core/misc.py b/src/ansys/mapdl/core/misc.py index e9bdc3cce4..ff0ddafb58 100644 --- a/src/ansys/mapdl/core/misc.py +++ b/src/ansys/mapdl/core/misc.py @@ -470,7 +470,7 @@ def _get_args_xsel(*args: Tuple[str], **kwargs: Dict[str, str]) -> Tuple[str]: vmin = kwargs.pop("vmin", args[3] if len(args) > 3 else "") vmax = kwargs.pop("vmax", args[4] if len(args) > 4 else "") vinc = kwargs.pop("vinc", args[5] if len(args) > 5 else "") - kabs = kwargs.pop("kabs", args[6] if len(args) > 6 else "") + kabs = kwargs.pop("kabs", kwargs.pop("kswp", args[6] if len(args) > 6 else "")) return type_, item, comp, vmin, vmax, vinc, kabs, kwargs diff --git a/tests/test_plotting.py b/tests/test_plotting.py index d9e8a6a29d..5da7280a2e 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -938,11 +938,15 @@ def test_asel_iterable(mapdl, make_block): ) -def test_vsel_iterable(mapdl, make_block): +def test_vsel_iterable_and_kswp(mapdl, make_block): mapdl.run("VGEN, 5, 1, , , 100, , , , , ") assert np.allclose( mapdl.vsel("S", "volu", "", [1, 2, 4], "", ""), np.array([1, 2, 4]) ) + mapdl.vsel("S", "volu", "", [1], "", "", kswp=1) + assert np.allclose(mapdl.geometry.vnum, [1]) and np.allclose( + mapdl.geometry.anum, [1, 2, 3, 4, 5, 6] + ) def test_color_areas(mapdl, make_block):