# Select elements from Dependent (child) Views & override

**URL:** <https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333>\
**Category:** Revit\
**Created:** [January 28, 2019, 11:28pm UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333 "2019-01-28T23:28:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cftrevizo](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cftrevizo](https://forum.dynamobim.com/u/cftrevizo)\
**Post date:** [January 28, 2019, 11:28pm UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333/1 "2019-01-28T23:28:40Z")

</div>

I’ve read lots of post to this similar Topic, but nothing to ever solidly answer “when those objects are in Child Views” that the Clockwork’s node Element.OwnerView seems to miss.

A great example I’ve read more commonly is selecting Revision Clouds that are on Dependent Views (Partial Plans). So here’s a great case scenario. I’m trying to find a way of not going into each of those views separately to run the script to override graphics. Attached script is where I’m currently at where I’m testing different avenues.  
My ultimate goal is to be able to create a visual Cue based on Instance Parameters, then be able to Reset those overrides the same way they were selected to begin with.

Any help in this example to get all “Elements” (either if 2D or 3D) that are on Dependent Views when selecting by a given parameter to filter them out is much appreciated. Getting them when in Independent Views is the easy part.  
[Override RevCloud Color\_for Dependent Views v2.dyn](https://forum.dynamobim.com/uploads/short-url/hUIEcIONtH4LsSVkpzdMmINNwpA.dyn) (57.3 KB)

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [January 29, 2019, 12:41am UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333/2 "2019-01-29T00:41:27Z")

</div>

_Element.OwnerView_ gets the Parent view because that is the owner view. Child Views are just a cropped version of that view but are really the same (on the front end, the back end they are different).

Are you trying to get an elements owner view then check to see if its a parent view and if so then check to see what child view the element shows up in and swap it out for the parent view?

Check out this bit of code by Amy. It will get you started on getting the child views. From there you would just need to check if the element is visible. Depending on how you views are set up the element may be shown in more than one child view.

> [@Find dependent view where element is visible](https://forum.dynamobim.com/t/find-dependent-view-where-element-is-visible/16874/7):
>
> This got me curious of how to find the dependent views with the API, so I ended up quickly writing this python script out and I think it is achieving what you’re aiming for: import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import\* clr.AddReference('RevitServices') from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager doc = DocumentManager.Instance.CurrentDBDocument views = UnwrapElement(…

---

<div class="post-metadata">

**Author:** ![cftrevizo](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cftrevizo](https://forum.dynamobim.com/u/cftrevizo)\
**Post date:** [January 29, 2019, 5:23pm UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333/3 "2019-01-29T17:23:21Z")

</div>

I’m just now getting my head wrapped around it. I guess too much reading for similar avenues that my subconsciousness had to clear up overnight (clear the cache, lol) to see things clearer now. Doing testing right now on @awilliams code, but I still can’t “Apply” the overrides to items in Child Views; it does it in the Parent View, but it doesn’t translate to the Child View when doing the “Override Per View”.

Please help correct the errors of my ways…

 ![Override%20RevCloud%20Color_for%20All%20Views](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/6/a69679c39c58b35ac4472a68b77e833868c9ef1a.png)

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [January 30, 2019, 5:18pm UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333/4 "2019-01-30T17:18:34Z")

</div>

You are adding the child views to the end of the list rather than replacing the parent views. You will need to then figure out what child views the element is visible then add an extra element for each addition view (past one view). Once your lists align then it should work fine.

---

<div class="post-metadata">

**Author:** ![cftrevizo](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cftrevizo](https://forum.dynamobim.com/u/cftrevizo)\
**Post date:** [January 31, 2019, 11:02pm UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333/5 "2019-01-31T23:02:11Z")

</div>

Going in circles to even only isolate the ones in child views ☹

 ![Override%20RevCloud%20Color_for%20All%20Views%20v5](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/d/bd249a6184eb81a4381dc406095863fb3a5eb83b.png)

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [January 31, 2019, 11:05pm UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333/6 "2019-01-31T23:05:12Z")

</div>

Just had a thought do you want to change it in both views?

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [January 31, 2019, 11:26pm UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333/7 "2019-01-31T23:26:09Z")

</div>

I am not a python pro so you may need to do some list management in your last script (not sure on this). This is also a bit overkill because it will change each cloud regardless if it is outside the crop region or not but it should work for you.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/9/59a1a559db1d6b5312abc2bfdae7a0a3428cf058.png)

---

<div class="post-metadata">

**Author:** ![cftrevizo](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cftrevizo](https://forum.dynamobim.com/u/cftrevizo)\
**Post date:** [February 1, 2019, 3:25pm UTC](https://forum.dynamobim.com/t/select-elements-from-dependent-child-views-override/31333/8 "2019-02-01T15:25:46Z")

</div>

Awesome. I’ll try it, & report back. It makes since that gabbing it from both Parent & Child is the most logical approach without going SuperNerdy into Python Scripting.
