<?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 Can I close a preview window on my button handler? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/can-i-close-a-preview-window-on-my-button-handler/m-p/12223790#M7443</link>
    <description>&lt;P&gt;Hi, Dears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a multi-plot module.&lt;/P&gt;&lt;P&gt;I am trying to create previous, next, and close buttons on my form applied to the preview window.&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code for single plot preview.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;PlotEngine pe = PlotFactory.CreatePreviewEngine((int)PreviewEngineFlags.Plot);
using (pe)
{
    PlotProgressDialog ppd = new PlotProgressDialog(false, 1, true);
    using (ppd)
    {
        ppd.set_PlotMsgString(
            PlotMessageIndex.DialogTitle,
            "Custom Plot Progress"
        );
        ppd.set_PlotMsgString(
            PlotMessageIndex.CancelJobButtonMessage,
            "Cancel Job"
        );
        ppd.set_PlotMsgString(
            PlotMessageIndex.CancelSheetButtonMessage,
            "Cancel Sheet"
        );
        ppd.set_PlotMsgString(
            PlotMessageIndex.SheetSetProgressCaption,
            "Sheet Set Progress"
        );
        ppd.set_PlotMsgString(
            PlotMessageIndex.SheetProgressCaption,
            "Sheet Progress"
        );
        ppd.LowerPlotProgressRange = 0;
        ppd.UpperPlotProgressRange = 100;
        ppd.PlotProgressPos = 0;

        ppd.OnBeginPlot();
        ppd.IsVisible = true;
        pe.BeginPlot(ppd, null);

        pe.BeginDocument(
            pi,
            doc.Name,
            null,
            1,
            true, // Let's plot to file
            "d:\\test-output"
        );

        ppd.OnBeginSheet();
        ppd.LowerSheetProgressRange = 0;
        ppd.UpperSheetProgressRange = 100;
        ppd.SheetProgressPos = 0;

        PlotPageInfo ppi = new PlotPageInfo();
        pe.BeginPage(
            ppi,
            pi,
            true,
            null
        );

        pe.BeginGenerateGraphics(null);
        pe.EndGenerateGraphics(null);

        PreviewEndPlotInfo pepi = new PreviewEndPlotInfo();
        pe.EndPage(pepi);
        ppd.SheetProgressPos = 100;
        ppd.OnEndSheet();

        pe.EndDocument(null);

        ppd.PlotProgressPos = 100;
        ppd.OnEndPlot();
        pe.EndPlot(null);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to access the preview window and pass a close command to it?&lt;/P&gt;&lt;P&gt;How should I approach this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reading.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Sep 2023 06:28:22 GMT</pubDate>
    <dc:creator>integtech</dc:creator>
    <dc:date>2023-09-07T06:28:22Z</dc:date>
    <item>
      <title>Can I close a preview window on my button handler?</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-i-close-a-preview-window-on-my-button-handler/m-p/12223790#M7443</link>
      <description>&lt;P&gt;Hi, Dears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a multi-plot module.&lt;/P&gt;&lt;P&gt;I am trying to create previous, next, and close buttons on my form applied to the preview window.&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code for single plot preview.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;PlotEngine pe = PlotFactory.CreatePreviewEngine((int)PreviewEngineFlags.Plot);
using (pe)
{
    PlotProgressDialog ppd = new PlotProgressDialog(false, 1, true);
    using (ppd)
    {
        ppd.set_PlotMsgString(
            PlotMessageIndex.DialogTitle,
            "Custom Plot Progress"
        );
        ppd.set_PlotMsgString(
            PlotMessageIndex.CancelJobButtonMessage,
            "Cancel Job"
        );
        ppd.set_PlotMsgString(
            PlotMessageIndex.CancelSheetButtonMessage,
            "Cancel Sheet"
        );
        ppd.set_PlotMsgString(
            PlotMessageIndex.SheetSetProgressCaption,
            "Sheet Set Progress"
        );
        ppd.set_PlotMsgString(
            PlotMessageIndex.SheetProgressCaption,
            "Sheet Progress"
        );
        ppd.LowerPlotProgressRange = 0;
        ppd.UpperPlotProgressRange = 100;
        ppd.PlotProgressPos = 0;

        ppd.OnBeginPlot();
        ppd.IsVisible = true;
        pe.BeginPlot(ppd, null);

        pe.BeginDocument(
            pi,
            doc.Name,
            null,
            1,
            true, // Let's plot to file
            "d:\\test-output"
        );

        ppd.OnBeginSheet();
        ppd.LowerSheetProgressRange = 0;
        ppd.UpperSheetProgressRange = 100;
        ppd.SheetProgressPos = 0;

        PlotPageInfo ppi = new PlotPageInfo();
        pe.BeginPage(
            ppi,
            pi,
            true,
            null
        );

        pe.BeginGenerateGraphics(null);
        pe.EndGenerateGraphics(null);

        PreviewEndPlotInfo pepi = new PreviewEndPlotInfo();
        pe.EndPage(pepi);
        ppd.SheetProgressPos = 100;
        ppd.OnEndSheet();

        pe.EndDocument(null);

        ppd.PlotProgressPos = 100;
        ppd.OnEndPlot();
        pe.EndPlot(null);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to access the preview window and pass a close command to it?&lt;/P&gt;&lt;P&gt;How should I approach this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reading.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 06:28:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-i-close-a-preview-window-on-my-button-handler/m-p/12223790#M7443</guid>
      <dc:creator>integtech</dc:creator>
      <dc:date>2023-09-07T06:28:22Z</dc:date>
    </item>
  </channel>
</rss>

