# How to copy Nodes using id?

**URL:** <https://discourse.slicer.org/t/how-to-copy-nodes-using-id/16572>\
**Category:** Development\
**Tags:** python\
**Created:** [March 16, 2021, 2:23pm UTC](https://discourse.slicer.org/t/how-to-copy-nodes-using-id/16572 "2021-03-16T14:23:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshay\_pillai](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akshay_pillai/32/8301_2.png) [@akshay\_pillai](https://discourse.slicer.org/u/akshay_pillai)\
**Post date:** [March 16, 2021, 2:23pm UTC](https://discourse.slicer.org/t/how-to-copy-nodes-using-id/16572/1 "2021-03-16T14:23:41Z")

</div>

I want to keep multiple copies of mrml nodes so that I can operate on the copies without changing the original. Kind of like clone option from data module. Is this possible? If so how can I implement it? For example - I want to create multiple copies of a curve. Any help is appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 16, 2021, 3:54pm UTC](https://discourse.slicer.org/t/how-to-copy-nodes-using-id/16572/2 "2021-03-16T15:54:07Z")

</div>

You can clone modules at many different levels. Data module’s clone feature uses the subject hierarchy plugin associated with the node, see example in the [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Clone_a_node).

---

<div class="post-metadata">

**Author:** ![akshay\_pillai](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akshay_pillai/32/8301_2.png) [@akshay\_pillai](https://discourse.slicer.org/u/akshay_pillai)\
**Post date:** [March 19, 2021, 1:32pm UTC](https://discourse.slicer.org/t/how-to-copy-nodes-using-id/16572/3 "2021-03-19T13:32:32Z")

</div>

@lassoan Hey, I see that I can copy nodes and volumes. Is there any way I can do the same thing for segments inside segmentation nodes? This seems to only work for vtkMRMLNode or vtkMRMLVolumeNode. And segments are vtkSegment

---

<div class="post-metadata">

**Author:** ![akshay\_pillai](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akshay_pillai/32/8301_2.png) [@akshay\_pillai](https://discourse.slicer.org/u/akshay_pillai)\
**Post date:** [March 19, 2021, 2:16pm UTC](https://discourse.slicer.org/t/how-to-copy-nodes-using-id/16572/4 "2021-03-19T14:16:44Z")

</div>

Update: I found the answer to that here: [How to programmatically use logical operator add function from segment editor? - #2 by mikebind](https://discourse.slicer.org/t/how-to-programmatically-use-logical-operator-add-function-from-segment-editor/16581/2)
