No announcement yet.

Select View by Name

  • Filter
  • Time
  • Show
Clear All
new posts

    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 Files

    Not through nodes but there's an OwnerViewId properties accessible throgh the API


      Here's what it looks like
      Revision Cloud.jpg

      # Import required librarires
      # Revit API to access the required properties of the Revision Cloud
      import clr
      from Autodesk.Revit.DB import*
      # RevitServices to access the REvit file content (aka document)
      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


        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?
        "One must imagine Sisyphus happy." Albert Camus - "The innovator has for enemies all those who have done well under the old conditions, and lukewarm defenders in those who may ​do well under the new." Nicolo Machiavelli -"Things that are too complex are not useful, Things that are useful are simple." Mikhail Kalashnikov


          Worksets is not going to work if... you don't have worksets
          That little python code will


            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.

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

            Attached Files


            Related Topics