Setting plot configuration to “none”

By Virupaksha Aithal
Below code shows the procedure to set the plot configuration to “none”. Code sets the model space plot configuration to “none”.

[CommandMethod("setNonePlotConfig")]
static public void setNonePlotConfig()
{
    Document doc = Application.DocumentManager.MdiActiveDocument;
    Database db = doc.Database;
 
    PlotSettingsValidator psv = PlotSettingsValidator.Current;
    LayoutManager layoutMgr = LayoutManager.Current;
 
    ObjectId layoutId = layoutMgr.GetLayoutId("Model");
 
    using (Transaction Tx = 
                        db.TransactionManager.StartTransaction())
    {
        Layout layout = 
            Tx.GetObject(layoutId, OpenMode.ForWrite) as Layout;
        psv.SetPlotConfigurationName(layout, 
                                     "None", "none_user_media");
        Tx.Commit();
    }
}

Comments

One response to “Setting plot configuration to “none””

  1. PlotConfigManager.get_StdConfigNames(StdConfiguration.NoneDevice) should be used instead of litteral “None”

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading