Skip to content

Commit

Permalink
FEAT: method to add notes on design (#5271)
Browse files Browse the repository at this point in the history
  • Loading branch information
anur7 authored Oct 11, 2024
2 parents d523f8a + e01cee8 commit 3841993
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
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.
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.")
"""
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

0 comments on commit 3841993

Please sign in to comment.