.NET

.NET

Reply
Contributor
sylvesp
Posts: 20
Registered: ‎10-07-2004
Message 1 of 4 (136 Views)

Is there a way to tell if a plot device requires to plot to file?

136 Views, 3 Replies
10-22-2011 07:46 AM

Can anybody help me with some advice about how to find out using the .NET API  if a plot device requires a file name when ploting?

 

E.g. choosing the plot to PDF device would require a file name.

 

Thanks,

Peter

Mentor
SENL1362
Posts: 167
Registered: ‎07-20-2011
Message 2 of 4 (115 Views)

Re: Is there a way to tell if a plot device requires to plot to file?

10-24-2011 03:23 AM in reply to: sylvesp

                PlotConfig tds = PlotConfigManager.CurrentConfig;
                string plotFile = null;
                if (tds.PlotToFileCapability == PlotToFileCapability.PlotToFileAllowed)
                {
                    tds.IsPlotToFile = true;
                    plotFile = Path.Combine(Path.GetDirectoryName(Application.DocumentManager.MdiActiveDocument.Database.Filename), Path.GetFileNameWithoutExtension(Application.DocumentManager.MdiActiveDocument.Database.Filename));
                    plotFile = plotFile + tds.DefaultFileExtension;
                    if (File.Exists(plotFile))
                        File.Delete(plotFile);

                }


if (tds.IsPlotToFile)

                        plotEngine.BeginDocument(plotInfo, Application.DocumentManager.MdiActiveDocument.Database.Filename, null, 1, true, plotFile);
                    else
                        plotEngine.BeginDocument(plotInfo, Application.DocumentManager.MdiActiveDocument.Database.Filename, null, 1, false, null);

Contributor
sylvesp
Posts: 20
Registered: ‎10-07-2004
Message 3 of 4 (97 Views)

Re: Is there a way to tell if a plot device requires to plot to file?

10-24-2011 11:09 AM in reply to: sylvesp

Thanks 100x!

Peter

Mentor
SENL1362
Posts: 167
Registered: ‎07-20-2011
Message 4 of 4 (78 Views)

Re: Is there a way to tell if a plot device requires to plot to file?

10-26-2011 11:56 PM in reply to: sylvesp

You're welcome. That's an easy question. Aks for adding custom media then things get interesting :smileywink:

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.