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

Plotting in vb.net

1 REPLY 1
Reply
Message 1 of 2
dheselwood
470 Views, 1 Reply

Plotting in vb.net


Someone help, my plotinfo isnt validating and I dont see whats wrong!



Dim PltInf As PlotInfo = New PlotInfo()



Dim PltSetVal As PlotSettingsValidator



Dim pltSet As PlotSettings = New PlotSettings(True)



Dim PltInfVal As PlotInfoValidator = New PlotInfoValidator()



Dim plotEng As PlotEngine = PlotFactory.CreatePublishEngine



Dim plotDialog As PlotProgressDialog = New PlotProgressDialog(False, 1, False)



For i = ActionList.Items.Count - 1 To 0 Step -1



Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(ActionList.Items.Item(i), True)



'progress meter



pubPage.PrintProgress.Value = ((ActionList.Items.Count * 100) - (i * 100))



pubPage.PrintVal.Text = i



'Set plot config



pltSet = New PlotSettings(True)



PltSetVal = PlotSettingsValidator.Current



PltInf.Layout = LayoutManager.Current.GetLayoutId("model")



PltSetVal.SetPlotConfigurationName(pltSet, lines(8), lines(9))



PltSetVal.SetPlotPaperUnits(pltSet, PlotPaperUnit.Millimeters)



PltSetVal.SetPlotRotation(pltSet, PlotRotation.Degrees090)



PltSetVal.SetPlotType(pltSet, Autodesk.AutoCAD.DatabaseServices.PlotType.Extents)



PltSetVal.SetPlotCentered(pltSet, True)



PltSetVal.SetCurrentStyleSheet(pltSet, lines(11))



PltSetVal.SetCanonicalMediaName(pltSet, lines(9))



PltInf.OverrideSettings = pltSet



PltSetVal = Nothing



PltInfVal.Validate(PltInf)



MsgBox("Validated:" & PltInf.IsValidated)



If plotEng IsNot Nothing Then



plotDialog.IsVisible = True



plotDialog.OnBeginPlot()



plotEng.BeginPlot(plotDialog, Nothing)



plotEng.BeginDocument(PltInf, ActionList.Items.Item(i), Nothing, lines(10), False, Nothing)



Dim pageinfo As PlotPageInfo = New PlotPageInfo()



plotDialog.OnBeginSheet()



plotEng.BeginPage(pageinfo, PltInf, True, Nothing)



plotEng.BeginGenerateGraphics(Nothing)



plotEng.EndGenerateGraphics(Nothing)



plotEng.EndPage(Nothing)



'plotDialog.OnEndSheet()



plotEng.EndDocument(Nothing)



plotEng.EndPlot(Nothing)



plotDialog.OnEndPlot()





End If



pltSet.Dispose()



PltInfVal.Dispose()



PltInf.Dispose()



plotDialog.Dispose()



plotEng.Dispose()



Next

1 REPLY 1
Message 2 of 2
dheselwood
in reply to: dheselwood

As normal, I went away and came back to this and managed to find the answer. Line 4 of my code specifies modelspace, you just need to change the value to false.

Dim pltSet As PlotSettings = New PlotSettings(True)

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