is drawing open?

is drawing open?

Anonymous
Not applicable
321 Views
6 Replies
Message 1 of 7

is drawing open?

Anonymous
Not applicable
hello all, what is the way to check thru VB6, to see if a drawing is open in a drawing editor, Scripting.FileSystemObject, does not seem to do the job. TIA
0 Likes
322 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
mark wrote: > what is the way to check thru VB6, to see > if a drawing is open in a drawing editor, > Scripting.FileSystemObject, does not seem > to do the job. Try GetObject using the path to the desired file. Be sure to enable error handling -- There are 10 kinds of people. Those who understand binary and those who don't. http://code.acadx.com (Pull the pin to reply)
0 Likes
Message 3 of 7

Anonymous
Not applicable
the getfile, attributes will work, if the file is read-only, but if the file is open by a user, it will not report it as RO... what i came up with is to search fso.fileexists(filename.dwl) the corresponding lock file of an open drawing, works fine, any drawbacks? what i am trying to do is to color in red, the drawing names in a VB6 filelistbox, all that are open by another user. thanks mark "Frank Oquendo" wrote in message news:401ebb21_1@newsprd01... > mark wrote: > > > what is the way to check thru VB6, to see > > if a drawing is open in a drawing editor, > > Scripting.FileSystemObject, does not seem > > to do the job. > > Try GetObject using the path to the desired file. Be sure to enable > error handling > > -- > There are 10 kinds of people. Those who understand binary and those who > don't. > > http://code.acadx.com > (Pull the pin to reply) > >
0 Likes
Message 4 of 7

Anonymous
Not applicable
mark wrote: > what i came up with is to search fso.fileexists(filename.dwl) > the corresponding lock file of an open drawing, works fine, > any drawbacks? Not every version of AutoCAD uses lock files so your solution isn't backward compatible. It also requires another level of abstraction in the use of the FileSystemObject when you could just go direct with GetObject as it is native to VBA. > what i am trying to do is to color in red, the drawing names > in a VB6 filelistbox, all that are open by another user. VB6 lets you change the color of individual line items in a list box? Even if you find a way to do this, from an end-user POV an option I don't know I have is better than one I'm aware of and cannot access. -- There are 10 kinds of people. Those who understand binary and those who don't. http://code.acadx.com (Pull the pin to reply)
0 Likes
Message 5 of 7

Anonymous
Not applicable
Use either a treeview or an imageview instead of a listbox and use different images for locked, unlocked, etc. ___________________________ Mike Tuersley CADalyst's AutoCAD Clinic Rand IMAGINiT Technologies
0 Likes
Message 6 of 7

Anonymous
Not applicable
I've used this with sme success: Public Function IsDwgOpen(fn As String) As Boolean 'returns true if a drawing is open already or read-only On Error GoTo ERROPEN Dim ff As Integer If fn = "" Then IsDwgOpen = False Exit Function End If ff = FreeFile Open fn For Binary Access Write Shared As ff Close ff IsDwgOpen = False Exit Function ERROPEN: IsDwgOpen = True End Function mark wrote: > hello all, > > what is the way to check thru VB6, to see > if a drawing is open in a drawing editor, > Scripting.FileSystemObject, does not seem > to do the job. > > TIA > >
0 Likes
Message 7 of 7

Anonymous
Not applicable
makes sense, thanks mark "michael montagne" wrote in message news:402172f9$1_1@newsprd01... > I've used this with sme success: > > Public Function IsDwgOpen(fn As String) As Boolean > 'returns true if a drawing is open already or read-only > On Error GoTo ERROPEN > Dim ff As Integer > If fn = "" Then > IsDwgOpen = False > Exit Function > End If > ff = FreeFile > Open fn For Binary Access Write Shared As ff > Close ff > IsDwgOpen = False > Exit Function > ERROPEN: > IsDwgOpen = True > End Function > > mark wrote: > > > hello all, > > > > what is the way to check thru VB6, to see > > if a drawing is open in a drawing editor, > > Scripting.FileSystemObject, does not seem > > to do the job. > > > > TIA > > > >
0 Likes