Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am having problems when trying to modify Layouts plot settings. I am using the same approach to plot the layouts and it works fine. Also, it works well when modifying the plot settings for the ModelSpace layout. I don't know what the problem is. The ConfigurationName is correct, so is the CanonicalMediaName and the Scale. I am not very clear about this process. Can someone take a look at my code and help me to figure out what is the problem.
Try
Trans = db.TransactionManager.StartTransaction
TableRec = CType(Trans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)
Layout = CType(Trans.GetObject(TableRec.LayoutId, OpenMode.ForWrite), Layout)
PltSettings = New PlotSettings(Layout.ModelType)
PltSettings.CopyFrom(Layout)
PSValidator = PlotSettingsValidator.Current
PSValidator.SetPlotConfigurationName(PltSettings, PlotInformation.PrinterName, PlotInformation.PaperSize)
PSValidator.SetUseStandardScale(PltSettings, True)
PSValidator.SetStdScaleType(PltSettings, PlotInformation.PlotScale)
PSValidator.SetPlotType(PltSettings, PlotInformation.PlotExtents)
PSValidator.SetPlotCentered(PltSettings, False)
PSValidator.RefreshLists(PltSettings)
PltInfo = New PlotInfo
PltInfo.Layout = TableRec.LayoutId
PltInfo.ValidatedSettings = PltSettings
PltInfoValidator = New PlotInfoValidator
PltInfoValidator.MediaMatchingPolicy = MatchingPolicy.MatchEnabled
PltInfoValidator.Validate(PltInfo)
Layout.CopyFrom(PltSettings)
Trans.Commit()
Return True
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return False
End TryI am getting the error message "eDeviceNotFound" on the line
PltInfoValidator.Validate(PltInfo)
Solved! Go to Solution.