.NET

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

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

141 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: 181
Registered: ‎07-20-2011
Message 2 of 4 (120 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 (102 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: 181
Registered: ‎07-20-2011
Message 4 of 4 (83 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
Need installation help?

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