.NET

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

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

142 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: 214
Registered: ‎07-20-2011
Message 2 of 4 (121 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 (103 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: 214
Registered: ‎07-20-2011
Message 4 of 4 (84 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
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!