<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DWG to PDF (Plotting a DWG model) in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265309#M12496</link>
    <description>&lt;P&gt;In the method&amp;nbsp;&lt;SPAN&gt;SetPlotConfigurationName(), the third argument should be CanonicalMediaName, not the media name you see in the "Paper size" dropdown list of the plot dialog, which is LocaleMediaName. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can find out CononicalMediaName corresponding to a known LocaleMediaName by using PlotConfig's CononicalMediaNames property and GetLocalMediaName([cononicalMediaName]) method.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jun 2022 01:13:23 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2022-06-29T01:13:23Z</dc:date>
    <item>
      <title>DWG to PDF (Plotting a DWG model)</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265259#M12494</link>
      <description>&lt;P&gt;Hi I'm a beginner in coding, I'm seeking some assistance on how to fix the code below. I'm currently getting errors during part ( plotSettingValidator.SetPlotConfigurationName(plotPositon, "DWG PDF.pc3", "ISO A1(841.00 x 594.00 MM)");.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a feeling it's something to do with the part (...,"DWG PDF.pc3"..).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; [CommandMethod("simplot")]
            static public void SimplePlot()

            {
                Document activeDocument = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.CurrentDocument;
                Editor documentEditor = activeDocument.Editor;

                Database fileData = activeDocument.Database;
                Transaction dwgFileInfo = fileData.TransactionManager.StartTransaction();

                using (dwgFileInfo)

                {
                    // Plotting the current layout
                    BlockTableRecord blockTableRecord = (BlockTableRecord)dwgFileInfo.GetObject(fileData.CurrentSpaceId, OpenMode.ForRead);
                    Layout layout = (Layout)dwgFileInfo.GetObject(blockTableRecord.LayoutId, OpenMode.ForRead); ;
                    PlotInfo plotInfo = new PlotInfo();

                    plotInfo.Layout = blockTableRecord.LayoutId;

                    PlotSettings plotPositon = new PlotSettings(layout.ModelType);
                    PlotSettingsValidator plotSettingValidator = PlotSettingsValidator.Current;
                    plotPositon.CopyFrom(layout);

                    //Layout of the plot with default settings 
                    plotSettingValidator.SetPlotType(plotPositon, Autodesk.AutoCAD.DatabaseServices.PlotType.Extents);
                    plotSettingValidator.SetUseStandardScale(plotPositon, true);
                    plotSettingValidator.SetStdScaleType(plotPositon, StdScaleType.StdScale1To1);
                    //plotSettingValidator.SetPlotCentered(plotPositon, true);
              
                    //plotSettingValidator.SetPlotConfigurationName(plotPositon, @"\\print\Pepe V2", "A4");
                    plotSettingValidator.SetPlotConfigurationName(plotPositon, "DWG PDF.pc3", "ISO A1(841.00 x 594.00 MM)");
                
                    plotInfo.OverrideSettings = plotPositon;
                    PlotInfoValidator plotInfoValidator = new PlotInfoValidator();
                    plotInfoValidator.MediaMatchingPolicy = MatchingPolicy.MatchEnabled;
                    plotInfoValidator.Validate(plotInfo);

                    if (PlotFactory.ProcessPlotState == ProcessPlotState.NotPlotting)
                    {
                        PlotEngine plotEnginge = PlotFactory.CreatePublishEngine();
                        using (plotEnginge)
                        {
                            // Create a Progress Dialog to provide info and allow the user to cancel
                            PlotProgressDialog dialogPlot = new PlotProgressDialog(false, 1, true);
                            using (dialogPlot)
                            {
                                dialogPlot.set_PlotMsgString(PlotMessageIndex.DialogTitle, "Custom Plot Progress");
                                dialogPlot.set_PlotMsgString(PlotMessageIndex.CancelJobButtonMessage, "Cancel Job");
                                dialogPlot.set_PlotMsgString(PlotMessageIndex.CancelSheetButtonMessage, "Cancel Sheet");
                                dialogPlot.set_PlotMsgString(PlotMessageIndex.SheetSetProgressCaption, "Sheet Set Progress");
                                dialogPlot.set_PlotMsgString(PlotMessageIndex.SheetProgressCaption, "Sheet Progress");
                                dialogPlot.LowerPlotProgressRange = 0;
                                dialogPlot.UpperPlotProgressRange = 100;
                                dialogPlot.PlotProgressPos = 0;

                                // Starting Plot scenario
                                dialogPlot.OnBeginPlot();
                                dialogPlot.IsVisible = true;
                                plotEnginge.BeginPlot(dialogPlot, null);

                                // We'll be plotting a single document
                                plotEnginge.BeginDocument(plotInfo, activeDocument.Name, null, 1, true, @"\\fileserver\users\drew.garcia\Desktop\Dummy Folder\DWG Test Files\Drawing1.dwg");

                                // Which contains a single sheet
                                dialogPlot.OnBeginSheet();
                                dialogPlot.LowerSheetProgressRange = 0;
                                dialogPlot.UpperSheetProgressRange = 100;
                                dialogPlot.SheetProgressPos = 0;

                                PlotPageInfo pageInfo = new PlotPageInfo();

                                plotEnginge.BeginPage(pageInfo, plotInfo, true, null);
                                plotEnginge.BeginGenerateGraphics(null);
                                plotEnginge.EndGenerateGraphics(null);

                                // Finish the sheet
                                plotEnginge.EndPage(null);
                                dialogPlot.SheetProgressPos = 100;
                                dialogPlot.OnEndSheet();

                                // Finish the document
                                plotEnginge.EndDocument(null);

                                // And finish the plot
                                dialogPlot.PlotProgressPos = 100;
                                dialogPlot.OnEndPlot();
                                plotEnginge.EndPlot(null);
                            }
                        }
                    }
                    else
                    {
                        documentEditor.WriteMessage("\nAnother plot is in progress.");
                    }

                }
            }       &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 00:53:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265259#M12494</guid>
      <dc:creator>Drew.GarciaUZTB3</dc:creator>
      <dc:date>2022-06-29T00:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: DWG to PDF (Plotting a DWG model)</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265292#M12495</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DrewGarciaUZTB3_0-1656464620409.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1085455i63572158143F0862/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DrewGarciaUZTB3_0-1656464620409.png" alt="DrewGarciaUZTB3_0-1656464620409.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That's the error that keeps showing up.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 01:04:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265292#M12495</guid>
      <dc:creator>Drew.GarciaUZTB3</dc:creator>
      <dc:date>2022-06-29T01:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: DWG to PDF (Plotting a DWG model)</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265309#M12496</link>
      <description>&lt;P&gt;In the method&amp;nbsp;&lt;SPAN&gt;SetPlotConfigurationName(), the third argument should be CanonicalMediaName, not the media name you see in the "Paper size" dropdown list of the plot dialog, which is LocaleMediaName. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can find out CononicalMediaName corresponding to a known LocaleMediaName by using PlotConfig's CononicalMediaNames property and GetLocalMediaName([cononicalMediaName]) method.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 01:13:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265309#M12496</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-06-29T01:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: DWG to PDF (Plotting a DWG model)</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265367#M12497</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DrewGarciaUZTB3_0-1656467514603.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1085478i1DA68F850B98B281/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DrewGarciaUZTB3_0-1656467514603.png" alt="DrewGarciaUZTB3_0-1656467514603.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;&amp;nbsp;thanks for quick response, but I'm still getting the same error&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 01:53:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11265367#M12497</guid>
      <dc:creator>Drew.GarciaUZTB3</dc:creator>
      <dc:date>2022-06-29T01:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: DWG to PDF (Plotting a DWG model)</title>
      <link>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11266672#M12498</link>
      <description>&lt;P&gt;Are you sure for the plot device "Dwg to Pdf.pc3" has a paper size defined with "Microsoft Print to PDF" as CanonicalMeadiaName?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where did you get your "DWG to PDF.pc3"? It is totally not possible a paper size with such a CanonicalMediaName. For the paper size "&lt;SPAN&gt;ISO A1(841.00 x 594.00 MM)&lt;/SPAN&gt;" (LocaleMediaName) from "DWG to PDF.pc3", the corresponding CanonicalMediaName is "&lt;STRONG&gt;ISO_A1_(841.00_x_594.00_MM)&lt;/STRONG&gt;". As my previous reply said, you need to learn how to find out CanonicalMediaName/LocaleMediaName using PlotConfig class.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 13:45:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dwg-to-pdf-plotting-a-dwg-model/m-p/11266672#M12498</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-06-29T13:45:52Z</dc:date>
    </item>
  </channel>
</rss>

