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

FEAT: method to add notes on design #5271

Merged
merged 8 commits into from
Oct 11, 2024
4 changes: 4 additions & 0 deletions _unittest/test_01_Design.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,7 @@ def test_42_save_project_with_file_name(self):
assert not os.path.exists(new_parent_dir)
self.aedtapp.save_project(file_name=new_project)
assert os.path.isfile(new_project)

def test_43_edit_notes(self):
assert self.aedtapp.edit_notes("this a test")
assert not self.aedtapp.edit_notes(1)
34 changes: 34 additions & 0 deletions src/ansys/aedt/core/application/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -4203,6 +4203,40 @@ def set_temporary_directory(self, path):
self.odesktop.SetTempDirectory(path)
return True

@pyaedt_function_handler()
def edit_notes(self, text):
"""Edit notes.
anur7 marked this conversation as resolved.
Show resolved Hide resolved

Notes are used to document aspects of designs only.

Parameters
----------
text : str
Text to be added in the design notes.

Returns
-------
bool
``True`` when successful, ``False`` when failed.

References
----------

>>> oDesign.EditNotes()

Examples
--------

>>> from ansys.aedt.core import Maxwell3d
>>> m3d = Maxwell3d()
>>> m3d.edit_notes("This is an example.")
"""
anur7 marked this conversation as resolved.
Show resolved Hide resolved
if not isinstance(text, str):
self.logger.error("Input type of edit_notes is not valid.")
return False
self.odesign.EditNotes(text)
return True


class DesignSettings:
"""Get design settings for the current AEDT app.
Expand Down
Loading