Author Topic: eGraphicsNotGenerated  (Read 2475 times)

0 Members and 1 Guest are viewing this topic.

TJK44

  • Guest
eGraphicsNotGenerated
« on: August 24, 2012, 03:36:57 PM »
Hi,

Has anyone ran across this error before and know what it means? It's happening at this line of code when trying to generate a PDF.

Code: [Select]
pe.BeginGenerateGraphics(Nothing)

Full Code:

Code: [Select]
                            Try
                                Dim layMgr As LayoutManager = LayoutManager.Current
                                Dim loObjId As ObjectId = layMgr.GetLayoutId(layMgr.CurrentLayout)
                                Dim lo As Layout = DirectCast(tr.GetObject(loObjId, OpenMode.ForRead), Layout)
                                Dim ps As New PlotSettings(lo.ModelType)
                                ps.CopyFrom(lo)
                                Dim pi As New PlotInfo()
                                pi.Layout = loObjId
                                Dim psv As PlotSettingsValidator = Autodesk.AutoCAD.DatabaseServices.PlotSettingsValidator.Current
                                psv.SetPlotConfigurationName(ps, "DWG To PDF.pc3", "ANSI_B_(11.00_x_17.00_Inches)")
                                psv.RefreshLists(ps)
                                psv.SetPlotType(ps, Autodesk.AutoCAD.DatabaseServices.PlotType.Extents)
                                psv.SetUseStandardScale(ps, True)
                                psv.SetStdScaleType(ps, StdScaleType.ScaleToFit)
                                pi.OverrideSettings = ps
                                Dim pe As PlotEngine = PlotFactory.CreatePublishEngine()
                                Try
                                    pe.BeginPlot(Nothing, Nothing)
                                    Dim validator As New PlotInfoValidator()
                                    validator.MediaMatchingPolicy = Autodesk.AutoCAD.PlottingServices.MatchingPolicy.MatchEnabled
                                    validator.Validate(pi)
                                    'Dim plotFile As String = Path.GetFullPath(Application.DocumentManager.MdiActiveDocument.Database.Filename)
                                    Dim plotFile As String = Path.GetFullPath(doc2.Name)
                                    plotFile = plotFile.Remove(plotFile.Length - 4)
                                    pe.BeginDocument(pi, doc.Name, Nothing, 1, True, plotFile & ".pdf")
                                    Dim pageInfo As New PlotPageInfo()
                                    pe.BeginPage(pageInfo, pi, True, Nothing)
                                    pe.BeginGenerateGraphics(Nothing)
                                    pe.EndGenerateGraphics(Nothing)
                                    pe.EndPage(Nothing)
                                    pe.EndDocument(Nothing)
                                    pe.EndPlot(Nothing)
                                Catch ex As System.Exception
                                    Windows.MessageBox.Show(ex.Message)
                                End Try
                                pe.Destroy()
                                tr.Commit()
                            Catch ex As System.Exception
                                Windows.MessageBox.Show(ex.Message)
                            End Try

Thanks for any help,

-Ted

t0w

  • Guest
Re: eGraphicsNotGenerated
« Reply #1 on: October 03, 2016, 06:37:26 AM »
Sry for reviving this,
resolving error for me was making sure that the image was not open in an Adobe Acrobat Reader DC tab.