Author Topic: App Events not working  (Read 9797 times)

0 Members and 1 Guest are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16723
  • Superior Stupidity at its best
Re: App Events not working
« Reply #30 on: July 12, 2007, 11:17:17 AM »


OK, this is a very naive question:

Jeff:

In the exposeappevents module
You have the code


Code: [Select]
Dim AppEvents As New EventsClass
-----------------------------------------
Sub acadstartup()
 
Set AppEvents.ACADApp = Application

End Sub

I understand that you made a new class module but what is actually triggering it (acadstartup)?

THanks

Mark




It doesn't need to be triggered, outside of AutoCAD starting up.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

ML

  • Guest
Re: App Events not working
« Reply #31 on: July 12, 2007, 11:18:31 AM »


Sorry, I meant to say a new class, not class module.

So you are saying that when ACAD starts, it calls the macro?

Mark

ML

  • Guest
Re: App Events not working
« Reply #32 on: July 12, 2007, 11:19:28 AM »

Which then triggers The ACADapp?

Mark

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16723
  • Superior Stupidity at its best
Re: App Events not working
« Reply #33 on: July 12, 2007, 01:19:51 PM »
yep
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Jeff_M

  • King Gator
  • Posts: 3945
  • C3D user & customizer
Re: App Events not working
« Reply #34 on: July 12, 2007, 01:57:21 PM »
To expand on Keith's excellent reply :-)

Just as Acad will autoload any acad.lsp, acaddoc.lsp, acad.rx acad.dvb, S::STARTUP (in lisp), and any associated MNL files, it will run an AcadStartup Sub in the now loaded Acad.dvb

ML

  • Guest
Re: App Events not working
« Reply #35 on: July 12, 2007, 02:21:00 PM »

Yeah Keith's explanation was pretty profound

Quote
Yep

LOL, I am just kidding Keith. Keith has been a GREAT help to me over the years, I owe him a great bit of gratitude.

Jeff, that was an excellent explanation, thank you

That really clarified a lot for me  :-)

I appreciate all your help!

Mark

ML

  • Guest
Re: App Events not working
« Reply #36 on: July 12, 2007, 02:23:48 PM »


Jeff,

You are a Land Desktop user.
With Land Desktop is it still necessary to use the acad.rx file to load the acvba.arx file in order to initialize VBA on startup?

Thank you

Mark

Jeff_M

  • King Gator
  • Posts: 3945
  • C3D user & customizer
Re: App Events not working
« Reply #37 on: July 12, 2007, 02:29:11 PM »
Yep :-)

ML

  • Guest
Re: App Events not working
« Reply #38 on: July 12, 2007, 02:30:58 PM »

Cool!

It looks like we've clarified this "event"  LOL   :-D

Thank you

ML

  • Guest
Re: App Events not working
« Reply #39 on: July 19, 2007, 10:57:42 AM »

Hey Jeff:

Pretty cool,

Branching out on The plot Event that you included
I added some VBScripting Language into The Plot Event

Mark

Code: [Select]
Private Sub ACADApp_BeginPlot(ByVal DrawingName As String)

Dim WshNetwork
Dim username

Set WshNetwork = CreateObject("WScript.Network")
username = WshNetwork.username


MsgBox "Drawing " & DrawingName & "has just received a request to plot for: " & username

End Sub

ML

  • Guest
Re: App Events not working
« Reply #40 on: July 19, 2007, 11:21:24 AM »

Jeff,

Also I noticed that sometimes when I make changes to the events, I have to re run my ExposeAppEvents (acadstartup) module

Code: [Select]
Dim AppEvents As New EventsClass

Sub acadstartup()
 
Set AppEvents.ACADApp = Application

End Sub

I don't think that should be necessary, do you?

Thanks

Mark




Jeff_M

  • King Gator
  • Posts: 3945
  • C3D user & customizer
Re: App Events not working
« Reply #41 on: July 19, 2007, 03:34:37 PM »
No, that seems odd. I'm pretty sure that I can make changes and they are immediately used.

ML

  • Guest
Re: App Events not working
« Reply #42 on: July 19, 2007, 03:55:21 PM »

Please

I would appreciate that   :-)

Mark

ML

  • Guest
Re: App Events not working
« Reply #43 on: July 24, 2007, 02:13:47 PM »

Oh I'm sorry
I tohught you had a fix
The same situation is still happening???

You would think the event itself would trigger the acadstartup?

Yes, I can have every event handler run acadstartup but this should not be neccessary  :?

So, you have not encountered this problem?

Mark

Bryco

  • Water Moccasin
  • Posts: 1849
Re: App Events not working
« Reply #44 on: July 24, 2007, 03:47:59 PM »
I reset with the AcadDocument_EndCommand "OPEN" and "NEW", notice this is a document level command.
There is also an application level Open and New, but these may not fire.
When you open a new drawing there is a point where thisdrawing changes ownership, this is where the application setting loses it's scope.