.NET

.NET

Reply
*Expert Elite*
Keith.Brown
Posts: 1,121
Registered: ‎03-13-2008
Message 1 of 3 (324 Views)
Accepted Solution

Formatting of Rollover ToolTips in AutoCAD MEP and AutoCAD Architecture

324 Views, 2 Replies
11-08-2013 03:22 PM

I have been attempting to follow this AutoCAD DEVBlog article on formatting rollover tooltips and I am running into issues.  Below is the exact code that I am using.  I have referenced accoremgd, acmgd, and acdbmgd.

 

using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
namespace ToolTipFormatting
{
    public class Class1 : IExtensionApplication
    {
        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]]><LineBreak/><Bold>BOLD</Bold><LineBreak/>" +
                                "<![CDATA[Iam]]><LineBreak/><Italic>Italic</Italic>" +
                                "<LineBreak/><![CDATA[Iam Normal");
            }
        }
        void IExtensionApplication.Terminate()
        {
            Document activeDoc = Application.DocumentManager.MdiActiveDocument;
            if (activeDoc != null)
            {
                activeDoc.Editor.PointMonitor -= new PointMonitorEventHandler(Editor_PointMonitor);
            }
        }
    }
}

 

When i try this code in straight vanila AutoCAD that is started from a desktop shortcut it works fine.  If i start AutoCAD MEP or AutoCAD Architecture it fails and instead of displaying the tooltip it displays the text string inside of the e.appendtooltiptext method,  If i start AutoCAD MEP and switch to the AutoCAD profile it will not work. So it seems to me that something that is loaded when MEP and ACA is loaded is keeping the tooltip from formatting correctly.  Has anyone else ran into this?  Does anyone know of a workaround to fix this?  Hopefully it is just a format change to the text string.

 

Thanks!


Keith Brown AutoCAD MEP BLOG | RSS Feed
AutoCAD MEP 2014 | Revit 2014 | EastCoast CAD/CAM V6.1 | Visual Studio 2013
────────────────────────────────────
⁞|⁞ Please use Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos as appropriate. Thank you!
ADN Support Specialist
Balaji_Ram
Posts: 692
Registered: ‎03-21-2011
Message 2 of 3 (300 Views)

Re: Formatting of Rollover ToolTips in AutoCAD MEP and AutoCAD Architecture

11-10-2013 08:51 PM in reply to: Keith.Brown

Hi Keith,

 

I have seen this behavior earlier and this is already logged as a request with our engineering team.

Sorry, I haven't found any workaround to get this working in ACA.

 

Regards,



Balaji
Developer Technical Services
Autodesk Developer Network

*Expert Elite*
Keith.Brown
Posts: 1,121
Registered: ‎03-13-2008
Message 3 of 3 (274 Views)

Re: Formatting of Rollover ToolTips in AutoCAD MEP and AutoCAD Architecture

11-13-2013 10:02 AM in reply to: Balaji_Ram

I kind of thought that would be the answer.  The good news is that i went ahead and monitored the tooltip opened event and when the tooltip was opened i just replaced the wpf control with my own.  I actually got better results using this method.  Thank you for taking the time to reply.


Keith Brown AutoCAD MEP BLOG | RSS Feed
AutoCAD MEP 2014 | Revit 2014 | EastCoast CAD/CAM V6.1 | Visual Studio 2013
────────────────────────────────────
⁞|⁞ Please use Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos as appropriate. Thank you!
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.