Пример #1
0
        private void ExportToSvf(JobConfig config, RuntimeLog log, Action <int> progressCallback)
        {
            var features = new Dictionary <Common.Formats.Svf.Navisworks.FeatureType, bool>();
            var options  = config.OutputOptions;

            if (options != null && options.Count > 0)
            {
                foreach (var option in options)
                {
                    if (Enum.TryParse(option, true, out Common.Formats.Svf.Navisworks.FeatureType result))
                    {
                        features[result] = true;
                    }
                }
            }

            var setting = new Bimangle.ForgeEngine.Common.Formats.Svf.Navisworks.ExportSetting();

            setting.ExportType = Common.Formats.Svf.Navisworks.ExportType.Folder;
            setting.OutputPath = config.OutputPath;
            setting.Features   = features.Where(x => x.Value).Select(x => x.Key).ToList();

            var exporter = new Bimangle.ForgeEngine.Navisworks.Pro.Svf.Exporter(App.GetHomePath());

            exporter.Export(setting, log, progressCallback, CancellationToken.None);
        }
Пример #2
0
        /// <summary>
        /// 开始导出
        /// </summary>
        /// <param name="setting"></param>
        /// <param name="progressCallback"></param>
        /// <param name="cancellationToken"></param>
        private void StartExport(ExportSetting setting, Action <int> progressCallback, CancellationToken cancellationToken)
        {
#if EXPRESS
            throw new NotImplementedException();
#else
            using (var log = new RuntimeLog())
            {
                var exporter = new Bimangle.ForgeEngine.Navisworks.Pro.Svf.Exporter(App.GetHomePath());
                exporter.Export(setting, log, progressCallback, cancellationToken);
            }
#endif
        }
Пример #3
0
        /// <summary>
        /// 开始导出
        /// </summary>
        /// <param name="targetPath"></param>
        /// <param name="exportType"></param>
        /// <param name="outputStream"></param>
        /// <param name="features"></param>
        /// <param name="progressCallback"></param>
        /// <param name="cancellationToken"></param>
        private void StartExport(string targetPath, ExportType exportType, Stream outputStream, Dictionary <FeatureType, bool> features, Action <int> progressCallback, CancellationToken cancellationToken)
        {
#if EXPRESS
            throw new NotImplementedException();
#else
            using (var log = new RuntimeLog())
            {
                var featureList = features?.Where(x => x.Value).Select(x => x.Key).ToList() ?? new List <FeatureType>();

                var exporter = new Bimangle.ForgeEngine.Navisworks.Pro.Svf.Exporter(App.GetHomePath());
                exporter.Export(
                    targetPath, exportType, outputStream, featureList,
                    log, progressCallback, cancellationToken
                    );
            }
#endif
        }