Donate Now Goal amount for this year: 2500 USD, Received: 1869 USD (75%)

Results 1 to 6 of 6
Like Tree7Likes
  • 1 Post By DanielHurtubise
  • 1 Post By DanielHurtubise
  • 1 Post By josephpeel
  • 2 Post By DanielHurtubise
  • 2 Post By ScubaMan

Thread: Select View by Name

  1. #1
    Member ScubaMan's Avatar
    Join Date
    July 6, 2015
    Posts
    201
    Current Local Time
    01:29 AM

    Select View by Name

    Hello all,

    I am wondering if it is possible to select a view by its name. I am trying to get the view a revision cloud is in through its workset (the view its in). Any one have any ideas?
    Attached Thumbnails Attached Thumbnails Select View by Name-capture.png  

  2. #2
    Moderator
    Join Date
    February 2, 2011
    Location
    Montreal/Paris
    Posts
    830
    Current Local Time
    03:29 AM
    Not through nodes but there's an OwnerViewId properties accessible throgh the API
    amoursol likes this.

  3. #3
    Moderator
    Join Date
    February 2, 2011
    Location
    Montreal/Paris
    Posts
    830
    Current Local Time
    03:29 AM
    Here's what it looks like
    Select View by Name-revision-cloud.jpg

    # Import required librarires
    # Revit API to access the required properties of the Revision Cloud
    import clr
    clr.AddReference('RevitAPI')
    from Autodesk.Revit.DB import*
    # RevitServices to access the REvit file content (aka document)
    clr.AddReference('RevitServices')
    from RevitServices.Persistence import DocumentManager
    # Define the doc you want to work with
    doc = DocumentManager.Instance.CurrentDBDocument

    #The inputs to this node will be stored as a list in the IN variables.
    dataEnteringNode = IN

    # Get the element ready for Dynamo usage
    # From that data retrieve the OwnerViewId
    revisioncloudids = [UnwrapElement(rc).OwnerViewId for rc in IN[0]]

    #Get each element's owener ID parameter
    ownerviews = [doc.GetElement(id) for id in revisioncloudids]

    #Assign your output to the OUT variable.
    OUT = ownerviews
    ScubaMan likes this.

  4. #4
    Forum Addict josephpeel's Avatar
    Join Date
    May 3, 2012
    Posts
    1,403
    Current Local Time
    10:29 AM
    Couldnt you just get all the views, get all their names, use First Index Off (View name from workset) and the Get Item at Index to get the corresponding view?
    ScubaMan likes this.

  5. #5
    Moderator
    Join Date
    February 2, 2011
    Location
    Montreal/Paris
    Posts
    830
    Current Local Time
    03:29 AM
    Worksets is not going to work if... you don't have worksets
    That little python code will
    josephpeel and amoursol like this.

  6. #6
    Member ScubaMan's Avatar
    Join Date
    July 6, 2015
    Posts
    201
    Current Local Time
    01:29 AM
    Wow Thank you both,

    They both do work rather well. I will have to test them on a large project to see how they preform.

    My end goal is to find a faster way find locate and export revision clouds. I have been using the script in this post but on really large project it can take up to an hour to run. https://www.revitforum.org/dynamo-bi...ameters-4.html

    I think both of the solutions you have provided will work wonders.




    Thanks,
    Steven
    Attached Thumbnails Attached Thumbnails Select View by Name-capture.png  
    amoursol and josephpeel like this.

Similar Threads

  1. Unable to select anything?!
    By Elliot Mott in forum Architecture and General Revit Questions
    Replies: 2
    Last Post: April 8th, 2016, 03:17 PM
  2. Select or view elements by host
    By gru3d in forum Architecture and General Revit Questions
    Replies: 1
    Last Post: March 28th, 2016, 02:42 AM
  3. Revit 2015- Regions wont stretch or chain select if created after Dependent view.
    By Twiceroadsfool in forum Architecture and General Revit Questions
    Replies: 2
    Last Post: September 10th, 2014, 08:42 PM
  4. Replies: 0
    Last Post: March 18th, 2012, 12:45 AM
  5. How to select a pad
    By willsud in forum Architecture and General Revit Questions
    Replies: 12
    Last Post: July 12th, 2011, 12:43 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
  •