Unverified Commit a3fcc707 authored by RevitArkitek's avatar RevitArkitek Committed by GitHub

#65 - Adds handlers for GetTemplateParameterIds and GetNonControlledTemplateParameterIds (#66)

Co-authored-by: default avatarmichaelcoffey <michael.coffey@ideateinc.com>
parent 93d491bb
Pipeline #225301585 passed with stages
in 10 minutes and 47 seconds
......@@ -140,6 +140,8 @@
<Compile Include="Snoop\Data\MemberSeparator.cs" />
<Compile Include="Snoop\Data\ElementPhaseStatuses.cs" />
<Compile Include="Snoop\Data\SnoopableObjectWrapper.cs" />
<Compile Include="Snoop\Data\ViewGetTemplateParameterIds.cs" />
<Compile Include="Snoop\Data\ViewGetNonControlledTemplateParameterIds.cs" />
<Compile Include="Snoop\Data\ViewFiltersOverrideGraphicSettings.cs" />
<Compile Include="Snoop\Data\ViewFiltersVisibilitySettings.cs" />
<Compile Include="Snoop\Forms\ParamEnum.cs">
......
......@@ -47,6 +47,12 @@ namespace RevitLookup.Snoop.CollectorExts
if (declaringType == typeof(View) && methodInfo.Name == nameof(View.GetFilterVisibility))
return new ViewFiltersVisibilitySettings(methodInfo.Name, (View) elem);
if (declaringType == typeof(View) && methodInfo.Name == nameof(View.GetNonControlledTemplateParameterIds))
return new ViewGetNonControlledTemplateParameterIds(methodInfo.Name, (View)elem);
if (declaringType == typeof(View) && methodInfo.Name == nameof(View.GetTemplateParameterIds))
return new ViewGetTemplateParameterIds(methodInfo.Name, (View)elem);
if (declaringType == typeof (Document) && methodInfo.Name == nameof(Document.Close))
return null;
......
using System.Linq;
using Autodesk.Revit.DB;
namespace RevitLookup.Snoop.Data
{
public class ViewGetNonControlledTemplateParameterIds : Data
{
private readonly View _view;
public ViewGetNonControlledTemplateParameterIds(string label, View view) : base(label)
{
_view = view;
}
public override string StrValue()
{
return "< view non controlled template parameter ids >";
}
public override bool HasDrillDown => !_view.Document.IsFamilyDocument && _view.IsTemplate && _view.GetNonControlledTemplateParameterIds().Any();
public override void DrillDown()
{
if (!HasDrillDown) return;
var viewParams = _view.Parameters.Cast<Parameter>().ToList();
var nonControlledTemplateParameterIds =
(from id in _view.GetNonControlledTemplateParameterIds()
select viewParams.Find(q => q.Id.IntegerValue == id.IntegerValue)
into p where p != null select new SnoopableObjectWrapper(p.Definition.Name, p)).ToList();
if (!nonControlledTemplateParameterIds.Any()) return;
var form = new Forms.Objects(nonControlledTemplateParameterIds);
form.ShowDialog();
}
}
}
\ No newline at end of file
using System.Linq;
using Autodesk.Revit.DB;
namespace RevitLookup.Snoop.Data
{
public class ViewGetTemplateParameterIds : Data
{
private readonly View _view;
public ViewGetTemplateParameterIds(string label, View view) : base(label)
{
_view = view;
}
public override string StrValue()
{
return "< view template parameter ids >";
}
public override bool HasDrillDown => !_view.Document.IsFamilyDocument && _view.IsTemplate && _view.GetTemplateParameterIds().Any();
public override void DrillDown()
{
if (!HasDrillDown) return;
var viewParams = _view.Parameters.Cast<Parameter>().ToList();
var templateParameterIds =
(from id in _view.GetTemplateParameterIds()
select viewParams.Find(q => q.Id.IntegerValue == id.IntegerValue)
into p where p != null select new SnoopableObjectWrapper(p.Definition.Name, p)).ToList();
if (!templateParameterIds.Any()) return;
var form = new Forms.Objects(templateParameterIds);
form.ShowDialog();
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment