Exemplo n.º 1
0
        /// <summary>
        ///     Set Filter overrides. If View doesn't have specified Filter, it will be first added to the View and then its settings will be overriden.
        ///     This behavior will persist even if View has a View Template applied which normally would prevent user from adding Filters without first
        ///     disabling or modifying the View Template.
        /// </summary>
        /// <param name="parameterFilter">Parameter filter</param>
        /// <param name="overrides">overrides settings</param>
        /// <returns name="view">View</returns>
        public Element SetFilterOverrides(Revit.Filter.ParameterFilterElement parameterFilter, Revit.Filter.OverrideGraphicSettings overrides)
        {
            RevitServices.Transactions.TransactionManager.Instance.EnsureInTransaction(Application.Document.Current.InternalDocument);
            this.InternalView.SetFilterOverrides(parameterFilter.InternalElement.Id, overrides.InternalOverrideGraphicSettings);
            RevitServices.Transactions.TransactionManager.Instance.TransactionTaskDone();

            return(this.InternalView.ToDSType(true));
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Set Filter overrides. If View doesn't have specified Filter, it will be first added to the View and then its settings will be overriden.
        ///     This behavior will persist even if View has a View Template applied which normally would prevent user from adding Filters without first
        ///     disabling or modifying the View Template.
        /// </summary>
        /// <param name="parameterFilter">Parameter Filter</param>
        /// <param name="overrides">Graphic Overrides Settings</param>
        /// <param name="hide">If True given Filter will be hidden.</param>
        /// <returns name="view">View</returns>
        public Revit.Elements.Views.View SetFilterOverrides(Revit.Filter.ParameterFilterElement parameterFilter, Revit.Filter.OverrideGraphicSettings overrides, bool hide = false)
        {
            RevitServices.Transactions.TransactionManager.Instance.EnsureInTransaction(Application.Document.Current.InternalDocument);
            this.InternalView.SetFilterOverrides(parameterFilter.InternalElement.Id, overrides.InternalOverrideGraphicSettings);
            this.InternalView.SetFilterVisibility(parameterFilter.InternalElement.Id, hide);
            RevitServices.Transactions.TransactionManager.Instance.TransactionTaskDone();

            return(this);
        }
Exemplo n.º 3
0
 /// <summary>
 ///     Add a Filter to a View. The Filter will be added even if View has a View Template applied, which normally would prevent user from adding
 ///     Filters without first disabling or modifying the View Template.
 /// </summary>
 /// <param name="parameterFilter">Parameter filter</param>
 /// <returns name="view">View</returns>
 public Revit.Elements.Views.View AddFilter(Revit.Filter.ParameterFilterElement parameterFilter)
 {
     if (!this.InternalView.IsFilterApplied(parameterFilter.InternalElement.Id))
     {
         RevitServices.Transactions.TransactionManager.Instance.EnsureInTransaction(Application.Document.Current.InternalDocument);
         this.InternalView.AddFilter(parameterFilter.InternalElement.Id);
         RevitServices.Transactions.TransactionManager.Instance.TransactionTaskDone();
     }
     return(this);
 }
Exemplo n.º 4
0
        /// <summary>
        ///     Get Filter overrides
        /// </summary>
        /// <returns name="overrides">Filter overrides</returns>
        public Revit.Filter.OverrideGraphicSettings FilterOverrides(Revit.Filter.ParameterFilterElement parameterFilter)
        {
            OverrideGraphicSettings overrides = this.InternalView.GetFilterOverrides(parameterFilter.InternalElement.Id);

            return(new Revit.Filter.OverrideGraphicSettings(overrides));
        }