TheSwamp

Code Red => VB(A) => Topic started by: iliekater on March 30, 2009, 08:44:58 AM

Title: Findin when a file is open
Post by: iliekater 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 .
Title: Re: Findin when a file is open
Post by: Bob Wahr 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
Title: Re: Findin when a file is open
Post by: iliekater 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 !
Title: Re: Findin when a file is open
Post by: Bob Wahr on April 05, 2009, 10:15:02 AM
glad it helped.