.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
Reply
Message 1 of 4
sylvesp
384 Views, 3 Replies

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

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

3 REPLIES 3
Message 2 of 4
SENL1362
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);

Message 3 of 4
sylvesp
in reply to: sylvesp

Thanks 100x!

Peter

Message 4 of 4
SENL1362
in reply to: sylvesp

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost