Author Topic: netload - loaded message.  (Read 4257 times)

0 Members and 1 Guest are viewing this topic.

surveyor_randy

  • Guest
netload - loaded message.
« on: July 07, 2008, 09:39:52 AM »
Is there a way to have a message displayed on the command line after loading a .DLL with netload.  A small message telling you how to invoke the custom command perhaps?  I tried using a 'main' subroutine within the class, but it didn't work.  Thank you.

Chuck Gabriel

  • Guest
Re: netload - loaded message.
« Reply #1 on: July 07, 2008, 09:44:07 AM »
If you inherit from IExtensionApplication, you can print a message from the Initialize method.

My workstation is down at the moment, so I can't really go into more detail.  I'll post an example later if you need it, or maybe somebody else will come along to elaborate.

Glenn R

  • Guest
Re: netload - loaded message.
« Reply #2 on: July 07, 2008, 09:47:46 AM »
A quick search for, as Chuck previously suggested, IExtensionApplication, turns up a nice example from Kerry here.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8723
  • AKA Daniel
Re: netload - loaded message.
« Reply #3 on: July 07, 2008, 09:49:35 AM »
There are many examples of IExtensionApplication in this forum. Here is one from master Kerry
http://www.theswamp.org/index.php?topic=23139.msg278190#msg278190

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8723
  • AKA Daniel
Re: netload - loaded message.
« Reply #4 on: July 07, 2008, 09:51:07 AM »
A quick search for, as Chuck previously suggested, IExtensionApplication, turns up a nice example from Kerry here.

Ah!.... well thats two from master Kerry  :laugh:

surveyor_randy

  • Guest
Re: netload - loaded message.
« Reply #5 on: July 07, 2008, 09:53:39 AM »
Excellent!  Thanks for the prompt replies and help!

vegbruiser

  • Guest
Re: netload - loaded message.
« Reply #6 on: July 22, 2008, 10:36:20 AM »
If, Instead of a loaded message, you wanted a splash screen, you could implement the information given in the following post from Kean: -

http://tinyurl.com/6llro7

Here's my (VB.NET) implementation of it: -

Code: [Select]
Namespace SplashScreenTest
   Public Class Startup
       Inherits Splashscreen
       Implements Autodesk.AutoCAD.Runtime.IExtensionApplication
       Public Sub Initialize() Implements
IExtensionApplication.Initialize
           Dim ss As New Splashscreen()

           ' Rather than trusting these properties to be set
           ' at design-time, let's set them here
           ss.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
           ss.FormBorderStyle =
System.Windows.Forms.FormBorderStyle.None
           ss.Opacity = 0.8
           ss.Size = New System.Drawing.Size(900, 340)
           ss.TopMost = True
           ss.ShowInTaskbar = False

           ' Now let's disply the splash-screen
           AcadApp.ShowModelessDialog(AcadApp.MainWindow, ss, False)
           ss.Update()

           ' This is where your application should initialise,
           ' but in our case let's take a 1.5-second nap
           System.Threading.Thread.Sleep(1500)

           ss.Close()
       End Sub
       ' Implements Autodesk.AutoCAD.Runtime.IExtensionApplication
       Public Sub Terminate() Implements
IExtensionApplication.Terminate
       End Sub
   End Class
End Namespace

You need to have a userform (in this case) called Splashscreen and this code is then fired once the user loads the app.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: netload - loaded message.
« Reply #7 on: July 22, 2008, 01:23:51 PM »
thats a great idea, very cool.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

vegbruiser

  • Guest
Re: netload - loaded message.
« Reply #8 on: July 22, 2008, 04:23:50 PM »
Yeah, I used it in the code I posted here.

I guess you could extend the length of time the splash screen displays for and have the code do some initial processing? (or at the very least tell the users that's what the code is doing) :)

Glenn R

  • Guest
Re: netload - loaded message.
« Reply #9 on: July 22, 2008, 04:26:15 PM »
...or, have the splash screen fade in and fade out (changing transparency values based on a timer from memory), which is what I've done previously...

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: netload - loaded message.
« Reply #10 on: July 22, 2008, 04:28:39 PM »
Now that is even more cool!!!
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)