MessageManager#
- class ansys.mechanical.core.embedding.messages.MessageManager(app)#
Message manager for adding, fetching, and printing messages.
Overview#
Provide a DataFrame representation of all messages. |
|
Provide a custom string representation of the messages. |
|
Allow indexed access to messages. |
|
Return the number of messages. |
Import detail#
from ansys.mechanical.core.embedding.messages import MessageManager
Method detail#
- MessageManager.__repr__()#
Provide a DataFrame representation of all messages.
- MessageManager.__str__()#
Provide a custom string representation of the messages.
- MessageManager.__getitem__(index)#
Allow indexed access to messages.
- MessageManager.__len__()#
Return the number of messages.
- MessageManager.add(severity: str, text: str)#
Add a message and update the cache.
- Parameters:
Examples
>>> app.messages.add("info", "User clicked the start button.")
- MessageManager.remove(index: int)#
Remove a message by index.
- Parameters:
- index
int Index of the message to remove.
- index
Examples
>>> app.messages.remove(0)
- MessageManager.show(filter='Severity;DisplayString', max_messages=None) None#
Print all messages with full details.
- Parameters:
Examples
>>> app.messages.show() ... Severity: INFO ... DisplayString: Sample message.
>>> app.messages.show(max_messages=5)
- MessageManager.clear()#
Clear all messages.