Open DWG from VB6 in MDI mode

Open DWG from VB6 in MDI mode

Anonymous
Not applicable
304 Views
6 Replies
Message 1 of 7

Open DWG from VB6 in MDI mode

Anonymous
Not applicable
Can anyone help me with opening a drawing using VB6 in AutoCAD2000 in MDI
mode ?
I can open in R14 without a problem, but not in R2000....

Thanks in advance
Dave
0 Likes
305 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
acadApp.Documents.Open(,[ReadOnly])

--
"That's no ordinary rabbit."
http://www.acadx.com


"Dave Wilkinson" wrote in message
news:0A5630B9E0251DD06D567D259C0462DF@in.WebX.maYIadrTaRb...
> Can anyone help me with opening a drawing using VB6 in AutoCAD2000
in MDI
> mode ?
> I can open in R14 without a problem, but not in R2000....
>
> Thanks in advance
> Dave
>
>
0 Likes
Message 3 of 7

Anonymous
Not applicable
Thanks Frank.

One more question though Frank.
How do I check to see if AutoCAD 2000 is already open, and if so open the
drawing in that session ??

Many Thanks
Dave


"Frank Oquendo" wrote in message
news:332EA1DE27B6FB1DA91EFEED5DB51B49@in.WebX.maYIadrTaRb...
> acadApp.Documents.Open(,[ReadOnly])
>
> --
> "That's no ordinary rabbit."
> http://www.acadx.com
>
>
> "Dave Wilkinson" wrote in message
> news:0A5630B9E0251DD06D567D259C0462DF@in.WebX.maYIadrTaRb...
> > Can anyone help me with opening a drawing using VB6 in AutoCAD2000
> in MDI
> > mode ?
> > I can open in R14 without a problem, but not in R2000....
> >
> > Thanks in advance
> > Dave
> >
> >
>
>
0 Likes
Message 4 of 7

Anonymous
Not applicable
Dim acadApp As AcadApplication

On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application.15")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application.15")
If Err Then
MessageBox "Could not connect to AutoCAD"
Exit Sub
End If
End If
acadApp.Documents.Open(,[ReadOnly])

--
"That's no ordinary rabbit."
http://www.acadx.com


"Dave Wilkinson" wrote in message
news:53A83AF5EBA81DBF838E1C1029A55546@in.WebX.maYIadrTaRb...
> Thanks Frank.
>
> One more question though Frank.
> How do I check to see if AutoCAD 2000 is already open, and if so
open the
> drawing in that session ??
>
> Many Thanks
> Dave
0 Likes
Message 5 of 7

Anonymous
Not applicable
Works a treat Frank.
Thanks Once Again.

"Frank Oquendo" wrote in message
news:9C51216D28D9AB0E8F20B4F94CB82853@in.WebX.maYIadrTaRb...
> Dim acadApp As AcadApplication
>
> On Error Resume Next
> Set acadApp = GetObject(, "AutoCAD.Application.15")
> If Err Then
> Err.Clear
> Set acadApp = CreateObject("AutoCAD.Application.15")
> If Err Then
> MessageBox "Could not connect to AutoCAD"
> Exit Sub
> End If
> End If
> acadApp.Documents.Open(,[ReadOnly])
>
> --
> "That's no ordinary rabbit."
> http://www.acadx.com
>
>
> "Dave Wilkinson" wrote in message
> news:53A83AF5EBA81DBF838E1C1029A55546@in.WebX.maYIadrTaRb...
> > Thanks Frank.
> >
> > One more question though Frank.
> > How do I check to see if AutoCAD 2000 is already open, and if so
> open the
> > drawing in that session ??
> >
> > Many Thanks
> > Dave
>
>
0 Likes
Message 6 of 7

Anonymous
Not applicable
if you don't mind, what is the exact syntax for opening the drawing read
only?

is it:

acadApp.Documents.Open (strDrawingName, ReadOnly)

or is ReadOnly a variable that must be declared and set to true or false?

thanks,
chris b.

"Dave Wilkinson" wrote in message
news:0E40AA50D0C6AD843B0E19445B285FF7@in.WebX.maYIadrTaRb...
> Works a treat Frank.
> Thanks Once Again.
>
> "Frank Oquendo" wrote in message
> news:9C51216D28D9AB0E8F20B4F94CB82853@in.WebX.maYIadrTaRb...
> > Dim acadApp As AcadApplication
> >
> > On Error Resume Next
> > Set acadApp = GetObject(, "AutoCAD.Application.15")
> > If Err Then
> > Err.Clear
> > Set acadApp = CreateObject("AutoCAD.Application.15")
> > If Err Then
> > MessageBox "Could not connect to AutoCAD"
> > Exit Sub
> > End If
> > End If
> > acadApp.Documents.Open(,[ReadOnly])
> >
> > --
> > "That's no ordinary rabbit."
> > http://www.acadx.com
> >
> >
> > "Dave Wilkinson" wrote in message
> > news:53A83AF5EBA81DBF838E1C1029A55546@in.WebX.maYIadrTaRb...
> > > Thanks Frank.
> > >
> > > One more question though Frank.
> > > How do I check to see if AutoCAD 2000 is already open, and if so
> > open the
> > > drawing in that session ??
> > >
> > > Many Thanks
> > > Dave
> >
> >
>
>
0 Likes
Message 7 of 7

Anonymous
Not applicable
You can use True or False directly.

--
"That's no ordinary rabbit."
http://www.acadx.com

Visit my site for a chance to win
a free, autographed copy of
Jerry Winters' "AutoCAD Visual Basics"

"C. Brunner" wrote in message
news:5697E4704AACB20EFCF04C6B746E8943@in.WebX.maYIadrTaRb...
> if you don't mind, what is the exact syntax for opening the drawing
read
> only?
>
> is it:
>
> acadApp.Documents.Open (strDrawingName, ReadOnly)
>
> or is ReadOnly a variable that must be declared and set to true or
false?
>
> thanks,
> chris b.
0 Likes