diff --git a/src/pyedb/dotnet/edb.py b/src/pyedb/dotnet/edb.py index 15510c439c..433d00f46a 100644 --- a/src/pyedb/dotnet/edb.py +++ b/src/pyedb/dotnet/edb.py @@ -104,6 +104,12 @@ from pyedb.modeler.geometry_operators import GeometryOperators from pyedb.workflow import Workflow +GRPC_WARNING = ( + "Your ANSYS AEDT version is eligible to gRPC version, " + "You might consider switching to that version for better user experience." + "For more information please check this link: https://edb.docs.pyansys.com/version/dev/grpc_api/index.html" +) + class Edb(Database): """Provides the EDB application interface. @@ -199,6 +205,8 @@ def __init__( edbpath = str(edbpath) edbversion = get_string_version(edbversion) + if float(edbversion) >= 2025.2: + warnings.warn(GRPC_WARNING, UserWarning) self._clean_variables() Database.__init__(self, edbversion=edbversion, student_version=student_version) self.standalone = True diff --git a/src/pyedb/generic/design_types.py b/src/pyedb/generic/design_types.py index bdda08115a..187cf60b2c 100644 --- a/src/pyedb/generic/design_types.py +++ b/src/pyedb/generic/design_types.py @@ -19,6 +19,13 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +import warnings + +GRPC_WARNING = ( + "Your ANSYS AEDT version is eligible to gRPC version, " + "You might consider switching to that version for better user experience." + "For more information please check this link: https://edb.docs.pyansys.com/version/dev/grpc_api/index.html" +) # lazy imports @@ -114,6 +121,12 @@ def Edb( """ # Use EDB legacy (default choice) + if float(edbversion) >= 2025.2: + if not grpc: + warnings.warn(GRPC_WARNING, UserWarning) + else: + if grpc: + raise ValueError(f"gRPC flag was enabled however your ANSYS AEDT version {edbversion} is not compatible") if grpc: from pyedb.grpc.edb import Edb as app else: