Announcement

Collapse
No announcement yet.

Select View by Name

Collapse
X
 
  • 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

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

    Comment


      #3
      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
      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

      Comment


        #4
        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

        Comment


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

          Comment


            #6
            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 Files

            Comment

            Related Topics

            Collapse

            Working...
            X