Plotting in VB.NET

Plotting in VB.NET

Anonymous
Not applicable
344 Views
2 Replies
Message 1 of 3

Plotting in VB.NET

Anonymous
Not applicable
I have this code
which worked in VB6
It opens the drawing OK but get and error which is not in the code and wants to see the disassembly.

------------------
Dim A2K As AutoCAD.AcadApplication
Try
A2K = GetObject(, "AutoCAD.Application")
Catch
A2K = CreateObject("AutoCAD.Application")
End Try

Dim A2Kdwg As AutoCAD.AcadDocument = A2K.ActiveDocument
A2K.Visible = True
A2Kdwg.Application.Documents.Open(DWGName1)
A2Kdwg.ActiveDocument.plot.PlotToDevice("HP LaserJet 4050 Series PCL6")
----------------------------------
0 Likes
345 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
this works now
Dim A2K As AutoCAD.AcadApplication
Try
A2K = GetObject(, "AutoCAD.Application")
Catch
A2K = CreateObject("AutoCAD.Application")
End Try

Dim A2Kdwg As AutoCAD.AcadDocument = A2K.ActiveDocument
A2K.Visible = True
A2Kdwg.Application.Documents.Open(DWGName)
A2Kdwg.Application.ActiveDocument.Plot.PlotToDevice("HP LaserJet 4050 Series PCL6")
0 Likes
Message 3 of 3

Anonymous
Not applicable
Search this ng - either Frank or Tony answered the same q a week or two ago. If I remember correctly, acadApp has to be defined as an object not as acadapplication. -- ___________________________ Mike Tuersley CADalyst's AutoCAD Clinic Rand IMAGINiT Technologies
0 Likes