When displaying a rollover tip, AutoCAD uses the “additionalTooltipString” provided by us using the “monitorInputPoint” method to create a “TextBlock” WPF element. Assuming that the additionalTooltipString provided by us was “Hello”, the textblock gets created as :
<TextBlock TextWrapping=”Wrap”><![CDATA[ Hello ]]</TextBlock>
Here is a sample tooltip string to insert formatting tags such as Bold and Italic. This will work when the ROLLOVERTIPS system variable is set to “1”.
additionalTooltipString
= ACRX_T( "Iam]]>
BOLD
Italic
To try this using the AutoCAD .Net API, here is a sample code snippet :
void IExtensionApplication.Initialize()
{
Document activeDoc = Application.DocumentManager.MdiActiveDocument;
activeDoc.Editor.PointMonitor += new PointMonitorEventHandler(Editor_PointMonitor);
}
void Editor_PointMonitor(object sender, PointMonitorEventArgs e)
{
if (e.Context.GetPickedEntities().Length > 0)
{
e.AppendToolTipText(
"Iam]]>
BOLD
Italic


Leave a Reply to BalajiCancel reply