Donate Now Goal amount for this year: 2500 USD, Received: 1627 USD (65%)

Results 1 to 7 of 7
Like Tree7Likes
  • 1 Post By amoursol
  • 1 Post By chris.macko
  • 2 Post By ScubaMan
  • 1 Post By chris.macko
  • 1 Post By Yna_Db
  • 1 Post By chris.macko

Thread: Find matching elements in lists

  1. #1
    Senior Member chris.macko's Avatar
    Join Date
    April 12, 2011
    Location
    Chicago, IL
    Posts
    523
    Current Local Time
    05:58 PM

    Find matching elements in lists

    I'd think this would be something straight forward, but I'm having a lot of trouble making it work. I've got 2 lists of elements, one from a linked model and one from the local model. There are many common elements between them but there are also a few that exist on each side that aren't in the other, and since the outliers can happen anywhere, a straight comparison isn't working. I'm trying to generate a list showing just the matching elements so I can pull parameter settings from the link into the local elements. What's the best way to go about getting this compiled list?

  2. #2
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    11:58 PM
    Hello Chris,

    Have you tried the SetDifference node?

    Attached Thumbnails Attached Thumbnails Find matching elements in lists-revitforumquery_setdifference.jpg  
    chris.macko likes this.

  3. #3
    Senior Member chris.macko's Avatar
    Join Date
    April 12, 2011
    Location
    Chicago, IL
    Posts
    523
    Current Local Time
    05:58 PM
    Hi Sol,
    I had tried Set Union and == with cross product, but I don't think I tried Set difference yet. So is the idea to pull those out and use them to filter each list down to the same values? That seems like it could be a simpler way to do it. I'll give that a try and see what happens. Thanks for the suggestion.
    amoursol likes this.

  4. #4
    Member ScubaMan's Avatar
    Join Date
    July 6, 2015
    Posts
    199
    Current Local Time
    03:58 PM
    Chris,

    I think you may want SetIntersection. It will return Items which are in both list. You can see link below on the dynamo dictionary for a better explanation.

    Dynamo Dictionary

    You should take a look at SetIntersection, SetDifference, and SetUnion. They are very powerful nodes.
    amoursol and chris.macko like this.

  5. #5
    Senior Member chris.macko's Avatar
    Join Date
    April 12, 2011
    Location
    Chicago, IL
    Posts
    523
    Current Local Time
    05:58 PM
    Find matching elements in lists-grid-filters.png
    I was able to get the list I was looking for with 2 Set Difference nodes, but it looks like Set Intersection does the same thing in 1.. thanks for the tip. I'm still very new at this so it's a lot of guessing and googling. My next question to actually make this functional, is what's the best way to get the list of elements from this list of keys? We have a series of checkboxes on our gridlines here for visibility control (major, minor, demolished, area 1, area 2, etc) and I'm trying to automate a way to sync those checkboxes across linked models.
    amoursol likes this.

  6. #6
    Member
    Join Date
    September 19, 2015
    Posts
    163
    Current Local Time
    11:58 PM
    what's the best way to get the list of elements from this list of keys?
    If these keys are the Names of the grids, you could simply use ElementFilter.ByName from Beaker
    johnp likes this.

  7. #7
    Senior Member chris.macko's Avatar
    Join Date
    April 12, 2011
    Location
    Chicago, IL
    Posts
    523
    Current Local Time
    05:58 PM
    Find matching elements in lists-grid-filters2.png
    I got it working. I did end up using the Set Difference node with a filter by Boolean mask. Once I got the lists of grids lined up the rest wasn't too bad.
    Thanks for all the help! I Definitely needed that push in the right direction.
    amoursol likes this.

Similar Threads

  1. Finding elements find/replace tool
    By katewood1989 in forum Architecture and General Revit Questions
    Replies: 1
    Last Post: September 21st, 2016, 10:22 PM
  2. Replies: 7
    Last Post: June 24th, 2016, 05:38 PM
  3. Replies: 0
    Last Post: September 6th, 2012, 11:17 PM
  4. Replies: 0
    Last Post: July 21st, 2012, 10:15 AM
  5. Replies: 0
    Last Post: July 20th, 2012, 04:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •