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')#
Print all messages with full details.
- Parameters:
- filter
str
,optional
Semicolon separated list of message attributes to display. Default is “severity;message”. if filter is “*”, all available attributes will be displayed.
- filter
Examples
>>> app.messages.show() ... severity: info ... message: Sample message.
>>> app.messages.show(filter="time_stamp;severity;message") ... time_stamp: 1/30/2025 12:10:35 PM ... severity: info ... message: Sample message.
- MessageManager.clear()#
Clear all messages.