# How to replicate the behavior of "remove all markups from the active list" from the module "markups"

**URL:** <https://discourse.slicer.org/t/how-to-replicate-the-behavior-of-remove-all-markups-from-the-active-list-from-the-module-markups/6075>\
**Category:** Development\
**Created:** [March 8, 2019, 1:38pm UTC](https://discourse.slicer.org/t/how-to-replicate-the-behavior-of-remove-all-markups-from-the-active-list-from-the-module-markups/6075 "2019-03-08T13:38:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZiyunLiang](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@ZiyunLiang](https://discourse.slicer.org/u/ZiyunLiang)\
**Post date:** [March 8, 2019, 1:38pm UTC](https://discourse.slicer.org/t/how-to-replicate-the-behavior-of-remove-all-markups-from-the-active-list-from-the-module-markups/6075/1 "2019-03-08T13:38:05Z")

</div>

Hi, everyone!  
I’m writing a scripted module and I want to replicate the behavior of “_remove all markups from the active list_” from the module “_markups_” to my module. I have already replicated the behaviors like adding fiducials and get the coordinates of the fiducials but I just cannot replicate the one to delete fiducials.  
Does anyone know how to proceed?

Thank you!  
Andrea

---

<div class="post-metadata">

**Author:** ![gleman](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gleman](https://discourse.slicer.org/u/gleman)\
**Post date:** [March 8, 2019, 5:57pm UTC](https://discourse.slicer.org/t/how-to-replicate-the-behavior-of-remove-all-markups-from-the-active-list-from-the-module-markups/6075/2 "2019-03-08T17:57:38Z")

</div>

GetActiveListID() in the markups logic has the current id, then just RemoveAllMarkups()

```
markupsNode = slicer.util.getNode( slicer.modules.markups.logic().GetActiveListID() )
markupsNode.RemoveAllMarkups()

```

Or just remove a single markup with:

`markupsNode.RemoveMarkup(0)`

which will remove the Nth Markup

---

<div class="post-metadata">

**Author:** ![ZiyunLiang](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@ZiyunLiang](https://discourse.slicer.org/u/ZiyunLiang)\
**Post date:** [March 9, 2019, 2:02am UTC](https://discourse.slicer.org/t/how-to-replicate-the-behavior-of-remove-all-markups-from-the-active-list-from-the-module-markups/6075/3 "2019-03-09T02:02:48Z")

</div>

Fantastic! It worked. Thank you so much!😁
