Exemple #1
0
        /// <summary>
        /// Execute the command.
        /// </summary>
        public override void execute()
        {
            try
            {
                System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog();
                dialog.AddExtension = true;
                dialog.Title        = System.String.Format("{0} -- {1}", CadKit.Helios.Application.Instance.Name, _text);

                CadKit.Interfaces.IExportScene export = CadKit.Documents.Manager.Instance.ActiveView as CadKit.Interfaces.IExportScene;
                if (null != export)
                {
                    string finalFilter = "";
                    CadKit.Interfaces.Filters filters = export.Filters;
                    foreach (CadKit.Interfaces.Filter filter in filters)
                    {
                        finalFilter += (filter.Text + '|' + filter.Extensions + '|');
                    }
                    finalFilter   = finalFilter.TrimEnd(new char[] { '|' });
                    dialog.Filter = finalFilter;
                    dialog.ShowDialog();
                    string filename = dialog.FileName;
                    export.export(filename, _option);
                }
            }
            catch (System.Exception exception)
            {
                System.Console.WriteLine("Error 314952192: exception caught while trying to export scene.");
                System.Console.WriteLine("Message: {0}", exception.Message);
            }
        }
Exemple #2
0
 /// <summary>
 /// Export the scene.
 /// </summary>
 void CadKit.Interfaces.IExportScene.export(string filename, CadKit.Interfaces.SceneExport.Option option)
 {
     CadKit.Interfaces.IExportScene export = this.Panel as CadKit.Interfaces.IExportScene;
     if (null == export)
     {
         throw new System.Exception(System.String.Format("Error 1824824745: Failed to export scene file '{0}', feature not supported", filename));
     }
     export.export(filename, option);
 }