Author Topic: 2012 PointMonitorEventArgs.AppendToolTipText Not Working  (Read 6493 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
2012 PointMonitorEventArgs.AppendToolTipText Not Working
« on: May 08, 2011, 01:02:47 PM »
Has anyone noticed or will someone test to see if AppendToolTipText  in AutoCAD 2012 is working.

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Colors;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;

namespace ClassLibrary2
{
    public class Hover
    {
        [CommandMethod("HighlighBlockReferences")]
        public void HighlighBlockReferences()
        {
            Application.DocumentManager.MdiActiveDocument.Editor.PointMonitor += new PointMonitorEventHandler(HoverHandler);
        }

        private void HoverHandler(object sender, PointMonitorEventArgs e)
        {
            FullSubentityPath[] fsps = e.Context.GetPickedEntities();
            if (fsps.Length > 0)
            {
                FullSubentityPath fsp = fsps[0];
                using (Transaction tr = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
                {
                    try
                    {
                        Entity ent = (Entity)tr.GetObject(fsp.GetObjectIds()[0], OpenMode.ForRead);

                        if (ent is Circle)
                        {
                            Circle cir = ent.Id.GetObject(OpenMode.ForRead) as Circle;
                            double diam = cir.Diameter;
                            e.AppendToolTipText("Circle\nDiameter: " + diam);
                        }
                        else if (ent is Polyline)
                        {
                            Polyline pl = ent.Id.GetObject(OpenMode.ForRead) as Polyline;
                            double plneLength = pl.Length;
                            e.AppendToolTipText("Polyline\nLength: " + plneLength);
                        }                                               
                        else
                       
                        {
                            e.AppendToolTipText("YO MAMA");
                        }
                    }
                    catch
                    {
                        tr.Dispose();
                    }
                }
            }
        }
    }
}



Jeff H

  • Needs a day job
  • Posts: 6150
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #1 on: May 08, 2011, 02:12:54 PM »
I found a XML file in ProgramData that was updated around the day I downloaded 2012 and it had a serial number and worked to activate 2011 anyways,

The code posted works in 2011 and does not work in 2012

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #2 on: May 08, 2011, 09:34:47 PM »
Can't check your code right now, but ran mine that uses AppendToolTipText and it works fine in 2012. Are TT's turned on?

Jeff H

  • Needs a day job
  • Posts: 6150
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #3 on: May 08, 2011, 10:01:26 PM »
Can't check your code right now, but ran mine that uses AppendToolTipText and it works fine in 2012. Are TT's turned on?
Yes sir and now this popped up

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #4 on: May 09, 2011, 12:04:28 AM »
Ok, I was able to try your code now.....no problems.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #5 on: May 09, 2011, 12:36:29 AM »
Thanks Jeff,

Failed on 2 computers 32 & 64 bit.

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #6 on: May 09, 2011, 10:12:59 AM »
Weird, I've now run this in a handful of drawings (all using 2012 x64) and it's working without error. I even put a little command line notification in the Catch to inform if the Try is catching anything, and it is never shown.

Are you testing in your drawings and/or drawings created from your templates? How about using the OOTB acad.dwt?

Jeff H

  • Needs a day job
  • Posts: 6150
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #7 on: May 09, 2011, 01:53:44 PM »
Thanks Jeff,
To be more specific it shows regular tooltip or errors out and have not found or noticed anything consistence when errors happens. 
I was testing on OOTB acad.dwt and custom templates.


ADN said it was a known behavior in 2012.

So makes me wonder why it works for you?

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #8 on: May 09, 2011, 02:58:06 PM »
So makes me wonder why it works for you?
I've been told before that I am 'special', perhaps this is the reason? :-)

I'll keep it loaded to see if I can break it at some point.

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #9 on: May 10, 2011, 05:51:03 PM »
Jeff, are you building your 2012 project against .NET 4.0 or 3.5? It just dawned on me that all mine is set for 3.5.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #10 on: May 10, 2011, 05:53:54 PM »
Jeff, are you building your 2012 project against .NET 4.0 or 3.5? It just dawned on me that all mine is set for 3.5.

4.0
Can you load projects built with 3.5 and 4.0 with same config settings?

 

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #11 on: May 10, 2011, 06:14:31 PM »
I think you can load them, but can't debug....the acad.exe.config must be changed in 2012 in order to debug in VS2008 and that's what I'm currently using. I do have VS2010, I'll try to throw together a new 4.0 project tonight and see what happens.

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #12 on: May 10, 2011, 09:51:18 PM »
Well, new project in VS2010, built on .NET 4.0, C3D2012 x64, configured for .NET 4.0....

No errors, works fine. Left it running in a complex drawing for about 20 minutes as I worked, no problems.

So I don't know what I have that would allow it to work that you don't.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #13 on: May 11, 2011, 06:10:08 AM »
I need to be carefull about disclosure, but ..

From early May

"It appears AutoCAD 2012 has changed the behaviour of
the AcEdInputPointMonitorResult.output.setAdditionalTooltipString(text);
If ROLLOVERTIPS is off then it displays custom tool tips, but not when ROLLOVERTIPS is on.
This is completely the reverse of what was in 2011. Why?"

"The reported behavior is known behavior in AutoCAD 2012.
We have logged a change request against the behavior.
Change request number xxxxxxxx .
We are also working with engineering team to address the issue in AutoCAD 2012 service pack."


Sorry I can't test options at the moment.
« Last Edit: May 11, 2011, 06:17:26 AM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: 2012 PointMonitorEventArgs.AppendToolTipText Not Working
« Reply #14 on: May 12, 2011, 05:03:08 PM »
Thanks Kerry,


Will work with ROLLOVERTIPS set to 0(off)


I am guessing Jeff_M had that already set.