Unverified Commit 75b14f24 authored by RevitArkitek's avatar RevitArkitek Committed by GitHub
Browse files

Adds handler for GetSplitRegionOffsets (#69)



* #65 - Adds handlers for GetTemplateParameterIds and GetNonControlledTemplateParameterIds

* #68 - Adds handler for GetSplitRegionOffsets
Co-authored-by: default avatarmichaelcoffey <michael.coffey@ideateinc.com>
parent 39b90004
......@@ -140,6 +140,7 @@
<Compile Include="Snoop\Data\MemberSeparator.cs" />
<Compile Include="Snoop\Data\ElementPhaseStatuses.cs" />
<Compile Include="Snoop\Data\SnoopableObjectWrapper.cs" />
<Compile Include="Snoop\Data\ViewCropRegionShapeManagerGetSplitRegionOffsets.cs" />
<Compile Include="Snoop\Data\ViewGetTemplateParameterIds.cs" />
<Compile Include="Snoop\Data\ViewGetNonControlledTemplateParameterIds.cs" />
<Compile Include="Snoop\Data\ViewFiltersOverrideGraphicSettings.cs" />
......
......@@ -53,6 +53,9 @@ namespace RevitLookup.Snoop.CollectorExts
if (declaringType == typeof(View) && methodInfo.Name == nameof(View.GetTemplateParameterIds))
return new ViewGetTemplateParameterIds(methodInfo.Name, (View)elem);
if (declaringType == typeof(ViewCropRegionShapeManager) && methodInfo.Name == nameof(ViewCropRegionShapeManager.GetSplitRegionOffset))
return new ViewCropRegionShapeManagerGetSplitRegionOffsets(methodInfo.Name, (ViewCropRegionShapeManager)elem);
if (declaringType == typeof (Document) && methodInfo.Name == nameof(Document.Close))
return null;
......
using System.Collections.Generic;
using System.Linq;
using Autodesk.Revit.DB;
namespace RevitLookup.Snoop.Data
{
public class ViewCropRegionShapeManagerGetSplitRegionOffsets : Data
{
private readonly ViewCropRegionShapeManager _viewCropRegionShapeManager;
public ViewCropRegionShapeManagerGetSplitRegionOffsets(string label, ViewCropRegionShapeManager viewCropRegionShapeManager) : base(label)
{
_viewCropRegionShapeManager = viewCropRegionShapeManager;
}
public override string StrValue()
{
return "< Split Region Offsets >";
}
public override bool HasDrillDown => _viewCropRegionShapeManager != null && _viewCropRegionShapeManager.NumberOfSplitRegions > 1;
public override void DrillDown()
{
if (!HasDrillDown) return;
List<SnoopableObjectWrapper> cropRegionOffsetObjects = new List<SnoopableObjectWrapper>();
for (int i = 0; i < _viewCropRegionShapeManager.NumberOfSplitRegions; i++)
cropRegionOffsetObjects.Add(new SnoopableObjectWrapper("[" + i + "]", _viewCropRegionShapeManager.GetSplitRegionOffset(i)));
if (!cropRegionOffsetObjects.Any()) return;
var form = new Forms.Objects(cropRegionOffsetObjects);
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