# Automatically Deleting 3D Views

**URL:** <https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274>\
**Category:** Revit\
**Created:** [October 16, 2018, 5:58pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274 "2018-10-16T17:58:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mojtaba.vlj](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Mojtaba.vlj](https://forum.dynamobim.com/u/Mojtaba.vlj)\
**Post date:** [October 16, 2018, 5:58pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/1 "2018-10-16T17:58:25Z")

</div>

Hi dear friends

I worked on a script to create new 3D views based on each specified clash in Revit model (As shown in the first attached pic). I want to extend my script to automatically delete these new 3D views, which were created in the last run, before creating new 3D views based on new clashes.

![Created%203D%20views%20by%20the%20script](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/9/09edcd221a06434053283517dd4d3313280d38d9.png)

To delete my views, I tried to get all my 3D view names from the model, and filter it to use “Delete Elements” node to delete them, but it did not work unfortunately (Please see the attached pic).

 ![Filtering%20Views](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/7/d7255d5d70bec54c478e4f567deabeecb9e75de4.png)

Can anybody help me? How can I give sequence to our modules in Dynamo? In the same script I have a module to create new 3D views after each run. How can I delete these two 3D views first before creating new ones?  
Thanks and your helps will be appreciated 🙂

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [October 16, 2018, 6:10pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/2 "2018-10-16T18:10:45Z")

</div>

Hi @Mojtaba.vlj, you are trying to get a “True” with anything that matches “Clash”. You need to use a String.Contains “Clash” and then get the true/false from that to your List.FilterByBoolMask 🙂

---

<div class="post-metadata">

**Author:** ![Mojtaba.vlj](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Mojtaba.vlj](https://forum.dynamobim.com/u/Mojtaba.vlj)\
**Post date:** [October 16, 2018, 6:18pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/3 "2018-10-16T18:18:23Z")

</div>

Hi,yes. I want to delete views that has “Clash” in their name. Could you please send me a very simple example? Thanks

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [October 16, 2018, 6:31pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/4 "2018-10-16T18:31:37Z")

</div>

Of course :).

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/e/3ed34049fcde6734a4a8ba04653af08afac97094.png)

---

<div class="post-metadata">

**Author:** ![Mojtaba.vlj](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Mojtaba.vlj](https://forum.dynamobim.com/u/Mojtaba.vlj)\
**Post date:** [October 16, 2018, 6:57pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/5 "2018-10-16T18:57:27Z")

</div>

Thanks  
I tried and it does not work ☹

 ![1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/d/7d32d55743be925e6fd8f5a8f79f0a451ffd7476.png)

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [October 16, 2018, 7:01pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/6 "2018-10-16T19:01:51Z")

</div>

Can’t you do the deletion in Revit itself?  
(count your mouse clicks)

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [October 16, 2018, 7:08pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/7 "2018-10-16T19:08:49Z")

</div>

Between Element.GetParam node and String Contains node, you need a “String From Object” node to convert the value to String. 🙂

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [October 16, 2018, 7:22pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/8 "2018-10-16T19:22:52Z")

</div>

@CVestesen

Do you think those values are not strings already?

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [October 16, 2018, 7:27pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/9 "2018-10-16T19:27:57Z")

</div>

You’re right, didn’t notice. Just assumed they were not :-).

---

<div class="post-metadata">

**Author:** ![Mojtaba.vlj](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Mojtaba.vlj](https://forum.dynamobim.com/u/Mojtaba.vlj)\
**Post date:** [October 16, 2018, 7:29pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/10 "2018-10-16T19:29:04Z")

</div>

Thanks 🙂

It worked. But when I wanted to delete those views by “ **Elements.Delete** ” node from archilab, it gave me an error. I also tried it with “ **Tool.Eraser** ” node from SteamNodes, it did’nt give me any error but my views were not deleted.

 ![2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/d/8d185688f23a7290215002f21a536cc8886fedb5.png)

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [October 16, 2018, 7:30pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/11 "2018-10-16T19:30:15Z")

</div>

Try use a Flatten between Mask and Elements.Delete.

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [October 16, 2018, 7:31pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/12 "2018-10-16T19:31:06Z")

</div>

@Mojtaba.vlj

Null values are the culprit here i think.  
So the selection of 3D views is not working.  
A View must have a name

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [October 16, 2018, 7:40pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/13 "2018-10-16T19:40:48Z")

</div>

Just tried it. Removing the nulls will do it 🙂

---

<div class="post-metadata">

**Author:** ![Mojtaba.vlj](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Mojtaba.vlj](https://forum.dynamobim.com/u/Mojtaba.vlj)\
**Post date:** [October 16, 2018, 7:43pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/14 "2018-10-16T19:43:30Z")

</div>

I tried with Flatten between Mask and Elements.Delete. but it still doesn’t work.  
Thanks @Marcel_Rijsmus for your response. But when I check my 3D Views, I see all my views have a name. How can I remove nulls from the list?

 ![3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/f/9fe92ef572639cf14ae146225f8a717bab442345.png)

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [October 16, 2018, 7:47pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/15 "2018-10-16T19:47:40Z")

</div>

![PNG](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/1/31c481c13dc07e32f8e3cf7d6b43409430328267.jpeg)  
didn’t see at first

---

<div class="post-metadata">

**Author:** ![CVestesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cvestesen/32/56704_2.png) [@CVestesen](https://forum.dynamobim.com/u/CVestesen)\
**Post date:** [October 16, 2018, 7:48pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/16 "2018-10-16T19:48:53Z")

</div>

There is a node called ‘IsNull’ which returns a true/false. Use a Mask with that.

---

<div class="post-metadata">

**Author:** ![Mojtaba.vlj](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Mojtaba.vlj](https://forum.dynamobim.com/u/Mojtaba.vlj)\
**Post date:** [October 16, 2018, 8:37pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/17 "2018-10-16T20:37:11Z")

</div>

I tried again and finally it worked. Now my views could be deleted. Is null usual as shown in the following pic?

 ![4](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/f/0f8dec62ba437fca3dc73e725cbb3a84fcf2e801.png)

I have another issue. In my script, I have several modules. One of them is to delete my previous views created and saved in my models, and another one is to create new 3D views in my model based on the most updated clashes. Is there a way to give a sequence to the script operation? For example, first delete the previous views and then create new views. If both modules in my script work simultaneously, no new 3D views will be created.

Thanks you so much 🙂

---

<div class="post-metadata">

**Author:** ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)\
**Post date:** [October 16, 2018, 8:41pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/18 "2018-10-16T20:41:52Z")

</div>

Mabe the transaction end node or pass through node?

btw, if you see yellow or red nodes, something is wrong

---

<div class="post-metadata">

**Author:** ![Mojtaba.vlj](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@Mojtaba.vlj](https://forum.dynamobim.com/u/Mojtaba.vlj)\
**Post date:** [October 16, 2018, 9:00pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/19 "2018-10-16T21:00:32Z")

</div>

@CVestesen  
Thanks for your helps. Do you have any idea?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [October 16, 2018, 11:04pm UTC](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274/20 "2018-10-16T23:04:14Z")

</div>

@Mojtaba.vlj basically you can set up a ‘gate’ which forces the evaluation of the downstream content so you delete prior to creating the new content. These are easily made in a code block as follows:

List.LastItem({WaitFor,PassThrough});

This effectively says, don’t pass along the items that start the next stage of the graph until you get the items that finished that stage of the graph. If this isn’t obvious after reading it, please mark a solution here, check the rest of the forum for similar results, and then make a new topic for your new problem. This will allow others to learn from the help we give you.

[Next page](https://forum.dynamobim.com/t/automatically-deleting-3d-views/27274.md?page=2)
