Esempio n. 1
0
        /// <summary>
        /// Collect the parameters and export
        /// </summary>
        /// <returns></returns>
        public override bool Export()
        {
            base.Export();

            bool exported = false;

            //parameter :  views
            IList <ElementId> views = new List <ElementId>();

            if (m_currentViewOnly)
            {
                views.Add(m_activeDoc.ActiveView.Id);
            }
            else
            {
                foreach (Autodesk.Revit.DB.View view in m_selectViewsData.SelectedViews)
                {
                    views.Add(view.Id);
                }
            }
            // Default values
            m_exportFileVersion = ACADVersion.R2010;
            //parameter : DXFExportOptions dxfExportOptions
            DXFExportOptions dxfExportOptions = new DXFExportOptions();

            dxfExportOptions.ExportingAreas = m_exportOptionsData.ExportAreas;
            dxfExportOptions.ExportOfSolids = m_exportOptionsData.ExportSolid;
            dxfExportOptions.FileVersion    = m_exportFileVersion;
            dxfExportOptions.LayerMapping   = m_exportOptionsData.ExportLayerMapping;
            dxfExportOptions.LineScaling    = m_exportOptionsData.ExportLineScaling;
            //dxfExportOptions.MergedViews = m_exportOptionsData.ExportMergeFiles;
            dxfExportOptions.PropOverrides = m_exportOptionsData.ExportLayersAndProperties;
            dxfExportOptions.SharedCoords  = m_exportOptionsData.ExportCoorSystem;
            dxfExportOptions.TargetUnit    = m_exportOptionsData.ExportUnit;

            //Export
            exported = m_activeDoc.Export(m_exportFolder, m_exportFileName, views, dxfExportOptions);

            return(exported);
        }
        /// <summary>
        /// Collect the parameters and export
        /// </summary>
        /// <returns></returns>
        public override bool Export()
        {
            base.Export();

            bool exported = false;
            //parameter :  views
            IList<ElementId> views = new List<ElementId>();
            if (m_currentViewOnly)
            {
                views.Add(m_activeDoc.ActiveView.Id);
            }
            else
            {
                foreach (View view in m_selectViewsData.SelectedViews)
                {
                    views.Add(view.Id);
                }
            }

            // Default values
            m_exportFileVersion = ACADVersion.R2010;
            //parameter : DWGExportOptions dwgExportOptions
            DWGExportOptions dwgExportOptions = new DWGExportOptions();
            dwgExportOptions.ExportingAreas = m_exportOptionsData.ExportAreas;
            dwgExportOptions.ExportOfSolids = m_exportOptionsData.ExportSolid;
            dwgExportOptions.FileVersion = m_exportFileVersion;
            dwgExportOptions.LayerMapping = m_exportOptionsData.ExportLayerMapping;
            dwgExportOptions.LineScaling = m_exportOptionsData.ExportLineScaling;
            dwgExportOptions.MergedViews = m_exportOptionsData.ExportMergeFiles;
            dwgExportOptions.PropOverrides = m_exportOptionsData.ExportLayersAndProperties;
            dwgExportOptions.SharedCoords = m_exportOptionsData.ExportCoorSystem;
            dwgExportOptions.TargetUnit = m_exportOptionsData.ExportUnit;

            //Export
            exported = m_activeDoc.Export(m_exportFolder, m_exportFileName, views, dwgExportOptions);

            return exported;
        }