Author Topic: Findin when a file is open  (Read 1575 times)

0 Members and 1 Guest are viewing this topic.

iliekater

  • Guest
Findin when a file is open
« on: March 30, 2009, 08:44:58 AM »
Is there a way to catch up the moment when AutoCAD opens a file ? I quess something like an event . I look in all of the available events in the ThisDrawing module , but it seems there isn't anything like that . I found there is an event BeginClose , but I need something like "BeginOpen" . Is there anything similar .

Bob Wahr

  • Guest
Re: Findin when a file is open
« Reply #1 on: March 30, 2009, 11:30:34 AM »
I haven't looked for a way to do it for a few versions now but what I found at the time and have used since is

Code: [Select]
Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)

If FirstLine = "s::startup" Then

iliekater

  • Guest
Re: Findin when a file is open
« Reply #2 on: April 05, 2009, 06:33:48 AM »
I had one small problem . The string that is catched at the startup is not "s::startup" , but it's "[]s::startup" . I mean there is also a RECTANGULAR character (I wrote it here as "[" + "] " becouse I can't get that character) .
Anyway , that was still very helpfull , since I simply compared the last characters of the string . Thanks a lot !

Bob Wahr

  • Guest
Re: Findin when a file is open
« Reply #3 on: April 05, 2009, 10:15:02 AM »
glad it helped.