Author Topic: Change Title Bar Text in AutoCAD 2013 / 2014 Window  (Read 7188 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 860
Re: Change Title Bar Text in AutoCAD 2013 / 2014 Window
« Reply #15 on: April 03, 2014, 06:37:01 AM »
Yes, this is the old info :) I used it in the AutoCAD 2009 even :)

gpa

  • Guest
Re: Change Title Bar Text in AutoCAD 2013 / 2014 Window
« Reply #16 on: September 29, 2014, 08:41:37 AM »
Please advise how to apply this on AutoCAD 2014. VERY URGENT.

        [CommandMethod("doit")]
        static public void doit()
        {
            AcAp.Application.MainWindow.Text = "Hello world";
        }

Thanks...

this may work too

Code: [Select]
        [CommandMethod("doit")]
        static public void doit()
        {
            AcAp.Application.MainWindow.Text = "Hello world";
        }

A late re-visit.
Thanks Dan.
There's an expression that goes something like "Can't see the wood for the trees" ... probably applies :)

gpa

  • Guest
Re: Change Title Bar Text in AutoCAD 2013 / 2014 Window
« Reply #17 on: September 30, 2014, 07:33:37 AM »
Dear BlackBox,

Please assist how to do that and apply to AutoCAD 2014?
Appreciate your kind assistance and guide... or anyone else who willing to share...  :-D

Thank you to all of you who have taken time to respond.

Went with the C# option from BlackBox and works a treat in both 2013 and 2014. :-D

Not sure why I could not get my attempt to work, but never mind. Problem solved!

Cheers, Robbo.

We're happy to help, and that is kind of you to say... However I merely ported VB to C# (with minor changes) - I'd be remiss to take credit for what Xiaodong Liang wrote in the DevBlog article Kerry and yourself referenced above.  :-)

Cheers

Keith Brown

  • Swamp Rat
  • Posts: 597
Re: Change Title Bar Text in AutoCAD 2013 / 2014 Window
« Reply #18 on: September 30, 2014, 09:42:52 AM »
When you post the same question over and over people will just tend to ignore you.  You have asked the question several times and the answer has been posted in several forms.

Below I will post a complete class that will change the Title Bar.  The class below is as simple as it gets and if you are unable to get it to work then you will need to think about taking some basic .NET courses and/or read up on the .NET API for AutoCAD.   I would suggest going through the Autodesk training located at http://usa.autodesk.com/adsk/servlet/index?id=18162650&siteID=123112.  If you had already done the miminum and looked at this course then you would not be asking the questions that you are asking.


Code - C#: [Select]
  1. // Requires reference to accoremgd.dll, acdbmgd.dll, & acmgd.dll
  2.  
  3. using Autodesk.AutoCAD.Runtime;
  4. using AcApp = Autodesk.AutoCAD.ApplicationServices.Application;
  5.  
  6. [assembly: CommandClass(typeof(TheSwamp.Mep.TitleBar))]
  7. [assembly: ExtensionApplication(typeof(TheSwamp.Mep.TitleBar))]
  8.  
  9. namespace TheSwamp.Mep
  10. {
  11.     class TitleBar : IExtensionApplication
  12.     {
  13.         private const string TitleBarText = "Manually modified TitleBar Text";
  14.  
  15.         // Will change the text of the main window upon loading of the plugin.
  16.         public void Initialize()
  17.         {
  18.             AcApp.MainWindow.Text = "AutoCAD MEP 2014 - Brought to you by The Swamp.org";
  19.         }
  20.  
  21.         public void Terminate()
  22.         {
  23.         }
  24.  
  25.         // Will change the text of the main window when the command is ran.
  26.         [CommandMethod("ModifyTitleBar")]
  27.         static public void ModifyTitleBar()
  28.         {
  29.             AcApp.MainWindow.Text = TitleBarText;
  30.         }
  31.     }
  32. }


**Edit** To include comments as to what each method does.
« Last Edit: September 30, 2014, 09:59:51 AM by Keith Brown »
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013