Results 1 to 4 of 4

Thread: Archiving Details

  1. #1
    Active Member
    Join Date
    2004-08
    Posts
    50
    0 Did you find this post helpful? Yes

    Default Archiving Details

    I'm looking for a way to archive details for re-use. This would likely involve somehow exporting all drafting views from a project that have been placed on sheets. Whether they are exported to files, families, or a "holding" project is undetermined at this time. They would need to retain the Sheet/Number combination so the architects could find them easily by referring to printed sheets of past projects. Perhaps this info could be held in a database or perhaps it could be part of a file name or a view name.
    This the early stages of my idea and I'm unsure of the API and it's capabilities.
    Is it possible for the API to read and import from another file similar to the "Insert from File" function? Does the file need to be open?
    Is it possible export a drafting view to a file using API?

    Has anyone tackled this problem yet?

    -mjm

  2. #2
    Member
    Join Date
    2012-09
    Posts
    24
    0 Did you find this post helpful? Yes

    Default Re: Archiving Details

    I haven't had a chance to explore it myself, but 2014 introduced a new Copy/Paste API that sounds well suited to your purposes.

    As far as I know, it mimics the functionality of "Insert from File" quite closely.

    More info here: http://thebuildingcoder.typepad.com/...assertion.html

  3. #3
    Active Member
    Join Date
    2004-08
    Posts
    50
    0 Did you find this post helpful? Yes

    Default Re: Archiving Details

    Good idea! That is perfect for drafting views. I need to figure out how to rename them but that seems trivial. The next hurdle is detail views. Our practice is to use detail views and draft lines and components over the top. Then we turn the model portion off. So. All i need are the lines, text and detail components. I don't think I can copy those views with this new function. I'm looking for a way to copy all the elements I want into a temporary drafting view and then copy that to the "archive" file. Struggling. Still so new to Revit API and dotNET.

  4. #4
    Member
    Join Date
    2012-09
    Posts
    24
    0 Did you find this post helpful? Yes

    Default Re: Archiving Details

    Hope you've made some progress in the last month, but I've got a few more suggestions.

    If you want to retrieve elements from a view, you can use a FilteredElementCollector as follows:

    Code:
    Document doc; //the document you're dealing with
    View view; //assuming you've already retrieved the detail view that you're dealing with
    
    ElementMulticategoryFilter filter = new ElementMulticategoryFilter(new List<BuiltInCategory>{BuiltInCategory.OST_Curves, BuiltInCategory.OST_TextNotes, BuiltInCategory.OST_DetailComponents});
    
    FilteredElementCollector coll = new FilteredElementCollector(doc, view.Id).WherePasses(filter);
    
    //Access the elements or the element IDs, you shouldn't need both
    var elements = coll.ToElements();
    var elementIds = coll.ToElementIds();
    Tweak the categories in the ElementMulticategoryFilter to suit your needs.

    Once you have retrieved all of the elements that you want, you should be able to use the copy/paste API to copy these to a new view. You can also create the view programmatically if it doesn't already exist. Read the API docs for more info on how to do this.

Similar Threads

  1. 2012 archiving?
    By jessica.146534 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2011-08-02, 01:55 PM
  2. Can Windows Explorer Details include RFA details?
    By barrie.sharp in forum Revit Architecture - General
    Replies: 4
    Last Post: 2010-09-06, 09:24 AM
  3. Archiving
    By rhayes.99001 in forum CAD Management - General
    Replies: 3
    Last Post: 2008-04-08, 02:57 PM
  4. Archiving Best Practice
    By jeff.95551 in forum Revit - In Practice
    Replies: 8
    Last Post: 2008-01-07, 03:10 PM
  5. Project Archiving
    By Opie in forum CAD Management - General
    Replies: 14
    Last Post: 2007-03-07, 11:11 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
  •