- 积分
- 549
- 明经币
- 个
- 注册时间
- 2014-5-23
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
红色代码那里出错,错误提示是【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
|
|