Results 1 to 4 of 4

Thread: Run sub at startup

  1. #1
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default Run sub at startup

    I have setup the registry so that my DLL loads when AutoCAD starts up. After the DLL loads, i want it to run some subs to insure that no one has changed any settings on the computer and to load additional DLLs and look for updates on the network. I ran this code and everything is loading up good exept the ribbons do not show up in AutoCAD. You can change the workspace which will allow them to show up but this is a pain. Can you tell me what I am doing wrong or how to load the current work space.

    Code:
     Public Class Class1
        Implements IExtensionApplication
        Public Sub initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
            'Activate at Startup
            NewVersionRegistry()
            BAA_LoaderDllLoad()
            LoadOldVBA()
            Dim acPref As Autodesk.AutoCAD.Interop.AcadPreferences = Autodesk.AutoCAD.ApplicationServices.Application.Preferences
            acPref.Files.TempFilePath = RegValue(RegistryDetailKey, "AutoCADTempFolder")
            acPref.Files.TemplateDwgPath = RegValue(RegistryDetailKey, "AutoCADTemplateFolder")
            acPref.Files.QNewTemplateFile = RegValue(RegistryDetailKey, "AutoCADTemplateFile")
            acPref = Nothing
        End Sub
    
        Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
       
        End Sub
    End Class

  2. #2
    Active Member
    Join Date
    2006-08
    Location
    Brisbane : GMT+10
    Posts
    87
    Login to Give a bone
    0

    Default Re: Run sub at startup

    Have a look at Lab 6

    something like this Initialize method ...
    Code:
    		public void Initialize() 
    		{
    			AddContextMenu();
    			EmployeeOptions.AddTabDialog();
    		}

  3. #3
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default Re: Run sub at startup

    Quote Originally Posted by Kerry Brown View Post
    Have a look at Lab 6

    something like this Initialize method ...
    Code:
    		public void Initialize() 
    		{
    			AddContextMenu();
    			EmployeeOptions.AddTabDialog();
    		}
    I tried Initialize by itself and it did nothing. I don't know where the AddContextMenu and EmployeeOptions are from. I found Autodesk.AutoCAD.Windows.PaletteSet.PaletteAddContextMenu(Object, Autodesk.AutoCAD.Windows.PaletteAddContextMenuEventArgs) but I don't think that was what you were talking about. Where do I find "Lab 6". Maybe that will help me understand.

    Thanks for the reply!!!

  4. #4
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default Re: Run sub at startup

    I stuck a patch on it for now. But I would know what I did wrong.

    For now, I just sent a command to call the ribbons back up.
    doc.SendStringToExecute("_WSCURRENT " & vbCr, False, False, False)

Similar Threads

  1. How can I make a startUp Exe for Startup AutoCAD
    By 740176597380946 in forum ARX
    Replies: 6
    Last Post: 2013-05-24, 05:36 AM
  2. Customize Startup
    By rgomez.100934 in forum AutoCAD Customization
    Replies: 10
    Last Post: 2010-11-09, 10:47 PM
  3. Slow startup
    By Jmc3198 in forum AutoCAD Civil 3D - General
    Replies: 4
    Last Post: 2009-08-14, 05:02 PM
  4. Startup Switch for PN
    By dhallett in forum ACA General
    Replies: 1
    Last Post: 2009-02-04, 10:01 PM
  5. TL on startup...
    By SupremeTaco in forum Revit Architecture - General
    Replies: 3
    Last Post: 2009-01-15, 04:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •