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

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
Like Tree4Likes

Thread: Script for project files comparison?

  1. #1
    Senior Member biff's Avatar
    Join Date
    June 13, 2011
    Location
    Australia
    Posts
    846
    Current Local Time
    01:41 PM

    Script for project files comparison?

    I'm not a dynamo user. But i do have a question. Is it possible to write a script that compares 2 or more open projects and identifies if there are duplicate guid?

  2. #2
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    334
    Current Local Time
    03:41 AM
    GUID, as in shared parameter GUID?
    Quote Originally Posted by biff View Post
    I'm not a dynamo user. But i do have a question. Is it possible to write a script that compares 2 or more open projects and identifies if there are duplicate guid?
    Sendt fra min ONEPLUS A5000 med Tapatalk

  3. #3
    Senior Member biff's Avatar
    Join Date
    June 13, 2011
    Location
    Australia
    Posts
    846
    Current Local Time
    01:41 PM
    Sorry, I actually meant the ID number for each element.

  4. #4
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    334
    Current Local Time
    03:41 AM
    oh, that's the BATID.
    The Element.Id node will get that for you.
    I don't use Dynamo on a daily basis, so someone correct me here; you can only have dynamo look into one project at a time. So a workflow would be to open the two files one by one, and extract all the BATID's in two steps. Export them to an Excel spreadsheet, and find duplicates there?
    Last edited by tuekappel; August 14th, 2018 at 08:44 AM.

  5. #5
    Senior Member biff's Avatar
    Join Date
    June 13, 2011
    Location
    Australia
    Posts
    846
    Current Local Time
    01:41 PM
    Thank you for your thoughts. Sounds like what i need. So on multiple examples of the same project can i zero in by dynamo on the same components to compare their id? E.g. The north fascia? Big call maybe.

  6. #6
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    334
    Current Local Time
    03:41 AM
    script could look something like this:



    this would require you to select all the model elements in a 3Dview, another alternative would be to grab the elements category by category, that's what the four nodes below is for.
    Attached Thumbnails Attached Thumbnails Script for project files comparison?-2018-08-14_1127.png  
    biff likes this.

  7. #7
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    334
    Current Local Time
    03:41 AM
    -but let me prepare you: the BATID is not an unique number, so comparing two project files will probably show a lot of duplicates.

    The Element.UniqueID is, well, unique :-) -across all project files, ever.

    Attached Thumbnails Attached Thumbnails Script for project files comparison?-2018-08-14_1138.png  

  8. #8
    Senior Member biff's Avatar
    Join Date
    June 13, 2011
    Location
    Australia
    Posts
    846
    Current Local Time
    01:41 PM
    Yes the id the number i am after. Would it just be 2 projects or do you open 1 at a time and extract it?

  9. #9
    Member tuekappel's Avatar
    Join Date
    February 6, 2012
    Location
    Frederiksberg, Denmark
    Posts
    334
    Current Local Time
    03:41 AM
    1 at a time, as far as i'm concerned. I know of Dynamo wizards that can extract info from project files without opening them, but i'm no such wizard :-)

    The startCol and startRow parameters in the ExcelWriteToFile node, will allow you to enter the data in different columns, one for each project.

    I'm curious; why do you need to check the BATID up against each other?

    And did you know you can copy paste several BATID's just by selecting objects and clicking "ID's of selection"?

  10. #10
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    04:41 AM
    You can extract elements from multiple files at once by using a little Python and some nodes



    The python is:
    Code:
    import clr
    clr.AddReference("RevitAPI")
    import Autodesk
    from Autodesk.Revit.DB import *
    
    OUT = FilteredElementCollector(IN[0]).WhereElementIsNotElementType().ToElements()
    In essence, we are opening up a Revit Project in Headless Mode (With no interface) and querying the model itself for all Elements (Bear in mind - this is EVERYTHING inside the project: Phases, line styles, floor types, revisions ... the lot. If we want to only get families we run a different Filtered Element Collector) in the model. We then simply run a pattern check across them using Set.Difference that tells us what is different inside of each list of elements and we run this check across the Element Ids.
    Attached Thumbnails Attached Thumbnails Script for project files comparison?-revitforumquery_elementids.jpg  
    Last edited by amoursol; August 14th, 2018 at 12:28 PM.
    tuekappel, biff and cellophane like this.

Page 1 of 2 12 LastLast

Similar Threads

  1. Building Coder: Project Identifier and Fuzzy Comparison
    By Building Coder in forum Blog Feeds
    Replies: 0
    Last Post: December 21st, 2017, 09:15 AM
  2. Replacing TB's across multiple project files.
    By BrianMyers in forum Architecture and General Revit Questions
    Replies: 5
    Last Post: July 22nd, 2015, 12:59 PM
  3. batch upgrade project files
    By Ning Zhou in forum Architecture and General Revit Questions
    Replies: 4
    Last Post: February 8th, 2014, 01:39 AM
  4. Archiving Project Files
    By gdoherty0102 in forum Architecture and General Revit Questions
    Replies: 1
    Last Post: April 18th, 2012, 01:13 PM
  5. Looking for the post regarding cad files moving when project is reopened
    By sdbrownaia in forum Architecture and General Revit Questions
    Replies: 6
    Last Post: April 13th, 2011, 03:30 PM

Posting Permissions

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