From f721eac4a5a69b0025eb22961e15c86aa0adde99 Mon Sep 17 00:00:00 2001 From: Randy Frank <89219420+randallfrank@users.noreply.github.com> Date: Fri, 10 Nov 2023 03:34:39 -0500 Subject: [PATCH] Update for EnSight 242 (#336) --- src/ansys/pyensight/core/session.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ansys/pyensight/core/session.py b/src/ansys/pyensight/core/session.py index 86de95673b2..cb28d1401c9 100644 --- a/src/ansys/pyensight/core/session.py +++ b/src/ansys/pyensight/core/session.py @@ -1510,6 +1510,13 @@ def _convert_ctor(self, s: str) -> str: tail = s.find(", cached:yes") if tail == -1: break + # Subtype (PartType:, AnnotType:, ToolType:) + subtype = None + for name in ("PartType:", "AnnotType:", "ToolType:"): + location = s.find(name) + if (location != -1) and (location > id): + subtype = int(s[location + len(name) :].split(",")[0]) + break # isolate the block to replace prefix = s[:start] suffix = s[tail + tail_len :] @@ -1526,8 +1533,11 @@ def _convert_ctor(self, s: str) -> str: else: subclass_info = "" if attr_id is not None: - # if a "subclass" case and no subclass attrid value, ask for it... - if classname_lookup is not None: + if subtype is not None: + # the 2024 R2 interface includes the subtype + subclass_info = f",attr_id={attr_id}, attr_value={subtype}" + elif classname_lookup is not None: + # if a "subclass" case and no subclass attrid value, ask for it... remote_name = self.remote_obj(objid) cmd = f"{remote_name}.getattr({attr_id})" attr_value = self.cmd(cmd)