.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Visual Basic .NET Plotting

0 REPLIES 0
Reply
Message 1 of 1
cctbailey
256 Views, 0 Replies

Visual Basic .NET Plotting

Hi! I found some code elsewhere on this board that I am trying to implement in my program. I need to open a drawing and create a plt file of it. The code I'm trying to copy is:

objAutoCADDocs.Open(filelocation)

objAutoCADDoc = objAutoCADApp.ActiveDocument

objAutoCADDoc.PaperSpace.Layout.PlotType = AcPlotType.acExtents
objAutoCADDoc.PaperSpace.Layout.StandardScale = AcPlotScale.acScaleToFit
objAutoCADDoc.PaperSpace.Layout.CenterPlot = True
objAutoCADDoc.PaperSpace.Layout.ConfigName = "DWF6 ePlot.pc3"
objAutoCADDoc.Plot.PlotToFile(plotname)

objAutoCADDoc.Close()


This person did not post their Imports statements, but here is what I have:

Imports System
Imports System.Runtime.InteropServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports acadApp = Autodesk.AutoCAD.ApplicationServices.Application
Imports AcadDocument = Autodesk.AutoCAD.ApplicationServices.Document

Public Sub pltFileCreate()
acadApp.MainWindow.Visible = True
acadApp.MainWindow.WindowState = FormWindowState.Normal
Dim origSDI As Boolean = acadApp.Preferences.System.SingleDocumentMode
acadApp.Preferences.System.SingleDocumentMode = False
Dim objAutoCADDocs = acadApp.DocumentManager

Dim objAutoCADDoc As AcadDocument
objAutoCADDoc = objAutoCADDocs.Open("C:\Sample30x42Drawing.dwg")

End Sub

This all works great, but it dies when I try to copy the line above:

objAutoCADDoc = objAutoCADApp.ActiveDocument

When I try to set objAutoCADDoc equal to my acadApp.ActiveDocument, I get "'ActiveDocument' is not a memeber of 'Autodesk.AutoCAD.ApplicationServices.Application'." How can I set my objAutoCADDoc equal to the document that I open so I can access the plotting commands as in the example?

Any help would be greatly appreciated.

Christy
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost