Valued Mentor
411 Posts
29 Kudos
Registered: ‎01-27-2010
Post 1 of 3

How to use correctly the PlotSettingsValidator

367 Views, 2 Replies
12-18-2012 08:34 AM

I have a view on paper pace : Name "1200-900"  size : 1200 x 900 unit  (Unit : mm)


my little prg vb.bet :




                Dim tr As Transaction = db.TransactionManager.StartTransaction()

                Using (tr)
                    'Dim bt As BlockTable = tr.GetObject(db.BlockTableId, OpenMode.ForRead)
                    Dim btr As BlockTableRecord = tr.GetObject(db.CurrentSpaceId, OpenMode.ForRead)
                    Dim lo As Layout = tr.GetObject(btr.LayoutId, OpenMode.ForRead)

                    Dim pi As PlotInfo = New PlotInfo()
                    pi.Layout = btr.LayoutId

                    '// We need a PlotSettings object
                    '// based on the layout settings
                    '// witch we then customize

                    Dim ps As PlotSettings = New PlotSettings(lo.ModelType)

                    '// The PlotSettingsValidator helps
                    '// create a valid PlotSettings object

                    Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current

                    'retrieve the name of vue
                    Dim NomView As String = ChoixVue()

                    If NomView <> "" Then
                        psv.SetPlotViewName(ps, NomView) '"1200-900")
                        psv.SetPlotType(ps, Autodesk.AutoCAD.DatabaseServices.PlotType.View)

                        'HERE MY PROB !!
                        psv.SetPlotPaperUnits(ps, PlotPaperUnit.Millimeters)
                        'psv.SetUseStandardScale(ps, True)
                        'psv.SetStdScaleType(ps, StdScaleType.StdScale1To50)
                        'Dim Scale As CustomScale = New CustomScale(1, 30)
                        'psv.SetStdScale(ps, 0.0)
                        'psv.SetCustomPrintScale(ps, Scale)

                        'psv.SetPlotCentered(ps, True)

                        '***** Format paper

                        psv.SetPlotConfigurationName(ps, "DWG To PDF(Ce).pc3", "UserDefinedMetric (900.00 x 1500.00mm)")
                        '// We need to link the PlotInfo to the
                        '// PlotSettings and then validate it

                        pi.OverrideSettings = ps
                        Dim piv As PlotInfoValidator = New PlotInfoValidator()

                        piv.MediaMatchingPolicy = MatchingPolicy.MatchEnabled

                        If PlotFactory.ProcessPlotState = ProcessPlotState.NotPlotting Then


 I cant understand the :

- psv.SetStdScaleType(ps, StdScaleType.xxxx)

--> If i use 1to1 i dont see my drawing

--> if i use 1to 20 i see my draw  


but i want create a draw with exacty the size of my view. (The size is already finewith the paper of my DesignJet T610)


So how i can just retrieve the good page layout. (CTRL+P and enter work fine)


How is calculate the StdScaleType.StdScale1To50  or StdScaleType.StdScale1To1 ?


Valued Mentor
411 Posts
29 Kudos
Registered: ‎01-27-2010
Post 2 of 3

Re: How to use correctly the PlotSettingsValidator

12-18-2012 11:21 PM in reply to: AubelecBE
psv.SetPlotPaperUnits(ps, PlotPaperUnit.Millimeters)
Dim Scale As CustomScale = New CustomScale(1, 25.4)
psv.SetCustomPrintScale(ps, Scale)


I have now my correct size --> i have to scale the view with the ratio of 25.4 (Inche / mm)


i have set my plotpaperunits to mm  but why i need to convert the scale to units inche ?


why ?

How i can set the corret units to mm ?

ADN Support Specialist
352 Posts
27 Kudos
Registered: ‎07-24-2007
Post 3 of 3

Re: How to use correctly the PlotSettingsValidator

12-21-2012 01:59 PM in reply to: AubelecBE

I'm not really a Plot expert, but what are the UNITS of the DWG setup to be?

Fenton Webb

Developer Technical Services

Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!