# Finding file path of family types and deleting them

**URL:** <https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [November 30, 2017, 8:51am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976 "2017-11-30T08:51:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![PauLtus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paultus/32/48502_2.png) [@PauLtus](https://forum.dynamobim.com/u/PauLtus)\
**Post date:** [November 30, 2017, 8:51am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/1 "2017-11-30T08:51:02Z")

</div>

I’ve been working on a script to create, delete, and alter Family Types.

It’s working fine, the only step I yet have to take is deleting the files.  
Now, I’ve already managed to get the right Family Type to delete through the FamilyType.ByName node, and I know there’s a File.Delete node to get rid of specific files.

The big question is how to get from a Family Type output to a file path so I can delete that specific file. If that’s the right way to go about it of course.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [November 30, 2017, 8:57am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/2 "2017-11-30T08:57:07Z")

</div>

Try [Directory.Contents](http://dictionary.dynamobim.com/#/Core/File/Directory/Action/Contents) (see also the one in DanEdu package)

---

<div class="post-metadata">

**Author:** ![PauLtus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paultus/32/48502_2.png) [@PauLtus](https://forum.dynamobim.com/u/PauLtus)\
**Post date:** [November 30, 2017, 9:21am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/3 "2017-11-30T09:21:56Z")

</div>

I do have both these nodes. I however do not have the knowledge how exactly these work. I’m also not exactly comfortable experimenting with them as I wouldn’t want to delete some file somewhere that has nothing to do with what I’m doing in Revit.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [November 30, 2017, 9:26am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/4 "2017-11-30T09:26:20Z")

</div>

The testing phase is best done on test files, but I am not sure you could delete these files directly from Dynamo anyway…

---

<div class="post-metadata">

**Author:** ![PauLtus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paultus/32/48502_2.png) [@PauLtus](https://forum.dynamobim.com/u/PauLtus)\
**Post date:** [November 30, 2017, 9:28am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/5 "2017-11-30T09:28:08Z")

</div>

Certainly.  
I don’t know how this search function works exactly so I’m afraid I’d delete something that’s in a whole other project.

---

<div class="post-metadata">

**Author:** ![PauLtus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paultus/32/48502_2.png) [@PauLtus](https://forum.dynamobim.com/u/PauLtus)\
**Post date:** [November 30, 2017, 9:34am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/6 "2017-11-30T09:34:34Z")

</div>

The other problem with this node is that it loads in a file, not a path to one.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [November 30, 2017, 9:38am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/7 "2017-11-30T09:38:07Z")

</div>

Try to type “file path” in the Dictionary:  
[http://dictionary.dynamobim.com/#/Core/File/FilePath](http://dictionary.dynamobim.com/#/Core/File/FilePath)

---

<div class="post-metadata">

**Author:** ![PauLtus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paultus/32/48502_2.png) [@PauLtus](https://forum.dynamobim.com/u/PauLtus)\
**Post date:** [November 30, 2017, 9:46am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/8 "2017-11-30T09:46:28Z")

</div>

The annoyance is that there’s easy ways to get a file from a path, you can use these nodes you adviced to also find files.  
Just getting the path is the problem.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [November 30, 2017, 10:00am UTC](https://forum.dynamobim.com/t/finding-file-path-of-family-types-and-deleting-them/16976/9 "2017-11-30T10:00:52Z")

</div>

Use [String.Contains](http://dictionary.dynamobim.com/#/Core/String/Action/Contains) (Beaker has also interesting nodes for this kind of tasks) and then [Filter.ByBooleanMask](http://dictionary.dynamobim.com/#/Core/List/Action/FilterByBoolMask). See also if the [Primer](http://dynamoprimer.com/en/04_The-Building-Blocks-of-Programs/4-4_strings.html) can’t help…
