.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Formatting of Rollover ToolTips in AutoCAD MEP and AutoCAD Architecture

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Keith.Brown
1566 Views, 4 Replies

Formatting of Rollover ToolTips in AutoCAD MEP and AutoCAD Architecture

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!

4 REPLIES 4
Message 2 of 5
Balaji_Ram
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

Message 3 of 5
Keith.Brown
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.

Message 4 of 5

Was it easy to replace the WPF control? If so do you mind sharing how to do it? Civil 3D is built on ACA so I'm having the same issue showing the formatting. 

 

Thanks!

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 5 of 5

It was actually kind of easy once the process was understood.  I showed the code in a previous post which you can find at the link below.

 

https://forums.autodesk.com/t5/net/how-to-replace-autocad-rollover-tooltips-for-a-custom-wpf-user/m-...

 

I think that there is enough there to show everything but if you need more information let me know.  Good Luck!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost