# Combine models intersection / logical operator intersection by script

**URL:** <https://discourse.slicer.org/t/combine-models-intersection-logical-operator-intersection-by-script/24047>\
**Category:** Support\
**Created:** [June 25, 2022, 5:06pm UTC](https://discourse.slicer.org/t/combine-models-intersection-logical-operator-intersection-by-script/24047 "2022-06-25T17:06:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [June 25, 2022, 5:06pm UTC](https://discourse.slicer.org/t/combine-models-intersection-logical-operator-intersection-by-script/24047/1 "2022-06-25T17:06:41Z")

</div>

Hi everyone,  
does anybody know how to run intersection between two models (using combine models module) or two segments (using logical operators in segment editor) by python script??

Thank you very much for your help.

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 25, 2022, 9:23pm UTC](https://discourse.slicer.org/t/combine-models-intersection-logical-operator-intersection-by-script/24047/2 "2022-06-25T21:23:35Z")

</div>

There is the CombineModels module in the Sandbox extension that will allow you to do that. Check the test to see how it’s done by code

---

<div class="post-metadata">

**Author:** ![gfurnari](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@gfurnari](https://discourse.slicer.org/u/gfurnari)\
**Post date:** [June 26, 2022, 8:18am UTC](https://discourse.slicer.org/t/combine-models-intersection-logical-operator-intersection-by-script/24047/3 "2022-06-26T08:18:17Z")

</div>

Thank you very much @mau_igna_06.  
I tried to implment the code but i have a little problem: the output model is empty. I used getNode() to get my input models, is that right or should i use something else?  
thank you again for your help

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 26, 2022, 2:29pm UTC](https://discourse.slicer.org/t/combine-models-intersection-logical-operator-intersection-by-script/24047/4 "2022-06-26T14:29:47Z")

</div>

You can search “booleanoperation” on yhe BoneReconstructionPlanner extension to see how ot is done in that extension
