.NET

.NET

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

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

143 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: 232
Registered: ‎07-20-2011
Message 2 of 4 (122 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 (104 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: 232
Registered: ‎07-20-2011
Message 4 of 4 (85 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:

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.