Skip to content

Commit

Permalink
cleanup and test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremytammik committed Mar 18, 2019
1 parent fbb938b commit 170a914
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions CS/TestCmds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
//
#endregion // Header

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using System.Collections;

using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.Attributes;
using System.Reflection;

using RevitLookup.Snoop.Forms;
using System.Linq;

// Each command is implemented as a class that provides the IExternalCommand Interface

Expand Down Expand Up @@ -238,12 +239,16 @@ public Result Execute( ExternalCommandData cmdData, ref string msg, ElementSet e
}

/// <summary>
/// Snoop dependent elements using Element.GetDependentElements
/// Snoop dependent elements using
/// Element.GetDependentElements
/// </summary>
[Transaction( TransactionMode.Manual )]
public class CmdSnoopModScopeDependents : IExternalCommand
{
public Result Execute( ExternalCommandData cmdData, ref string msg, ElementSet elems )
public Result Execute(
ExternalCommandData cmdData,
ref string msg,
ElementSet elems )
{
Result result = Result.Failed;

Expand All @@ -254,11 +259,11 @@ public Result Execute( ExternalCommandData cmdData, ref string msg, ElementSet e
ICollection<ElementId> idPickfirst = uidoc.Selection.GetElementIds();
Document doc = uidoc.Document;

ICollection<Element> elemSet = new List<Element>(
ICollection<Element> elemSet = new List<Element>(
idPickfirst.Select<ElementId, Element>(
id => doc.GetElement( id ) ) );

ICollection<ElementId> ids = elemSet.SelectMany(
ICollection<ElementId> ids = elemSet.SelectMany(
t => t.GetDependentElements( null ) ).ToList();

Snoop.Forms.Objects form = new Snoop.Forms.Objects( doc, ids );
Expand Down

0 comments on commit 170a914

Please sign in to comment.