图纸打印问题
红色代码那里出错,错误提示是【eLayourNotCurrent】,代码在acm2006上没有问题,在acm2012上出错了,求助。谢谢!Dim btr As BlockTableRecord = tr.GetObject(db.CurrentSpaceId, OpenMode.ForRead)
Dim lo As Layout = tr.GetObject(btr.LayoutId, OpenMode.ForWrite)
Dim pi As PlotInfo = New PlotInfo()
pi.Layout = btr.LayoutId
Dim ps As PlotSettings = New PlotSettings(lo.ModelType)
ps.CopyFrom(lo)
Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current
psv.SetPlotWindowArea(ps, window)
psv.SetPlotType(ps, Autodesk.AutoCAD.DatabaseServices.PlotType.Window)
psv.SetUseStandardScale(ps, True)
psv.SetStdScaleType(ps, StdScaleType.ScaleToFit)
psv.SetPlotCentered(ps, True)
psv.SetPlotConfigurationName(ps, "FinePlot.pc3", "A4")
pi.OverrideSettings = ps
Dim piv As PlotInfoValidator = New PlotInfoValidator()
piv.MediaMatchingPolicy = MatchingPolicy.MatchEnabled
Try
piv.Validate(pi)
Catch ex As Exception
MsgBox(ex.Message)
End Try
页:
[1]