示例#1
0
        /// <summary>
        /// Same as in the windows app, but here we generate a VisInfo that is attached to the view
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnAddView(object sender, ExecutedRoutedEventArgs e)
        {
            try
            {
                if (Bcfier.SelectedBcf() == null)
                {
                    return;
                }
                var issue = e.Parameter as Markup;
                if (issue == null)
                {
                    MessageBox.Show("No Issue selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                var dialog = new AddViewRevit(issue, Bcfier.SelectedBcf().TempPath, uiapp.ActiveUIDocument.Document);
                dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                dialog.ShowDialog();
                if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
                {
                    //generate and set set the VisInfo
                    issue.Viewpoints.Last().VisInfo   = GenerateViewpoint();
                    Bcfier.SelectedBcf().HasBeenSaved = false;
                }
            }
            catch (System.Exception ex1)
            {
                TaskDialog.Show("Error adding a View!", "exception: " + ex1);
            }
        }
示例#2
0
        /// <summary>
        /// Same as in the windows app, but here we generate a VisInfo that is attached to the view
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnAddView(object sender, ExecutedRoutedEventArgs e)
        {
            try
              {

            if (Bcfier.SelectedBcf() == null)
              return;
            var issue = e.Parameter as Markup;
            if (issue == null)
            {
              MessageBox.Show("No Issue selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
              return;
            }

            var dialog = new AddViewRevit(issue, Bcfier.SelectedBcf().TempPath, uiapp.ActiveUIDocument.Document);
            dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            dialog.ShowDialog();
            if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
            {
              //generate and set set the VisInfo
              issue.Viewpoints.Last().VisInfo = GenerateViewpoint();
              Bcfier.SelectedBcf().HasBeenSaved = false;
            }

              }
              catch (System.Exception ex1)
              {
            TaskDialog.Show("Error adding a View!", "exception: " + ex1);
              }
        }