# How to calculate the closest distance between a control point and a model node

**URL:** https://discourse.slicer.org/t/how-to-calculate-the-closest-distance-between-a-control-point-and-a-model-node/25151
**Category:** Support
**Created:** [September 8, 2022, 8:30am UTC](https://discourse.slicer.org/t/how-to-calculate-the-closest-distance-between-a-control-point-and-a-model-node/25151 "2022-09-08T08:30:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![1023185654](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/1023185654/32/15829_2.png) [@1023185654](https://discourse.slicer.org/u/1023185654)
#### Post date: [September 8, 2022, 8:30am UTC](https://discourse.slicer.org/t/how-to-calculate-the-closest-distance-between-a-control-point-and-a-model-node/25151/1 "2022-09-08T08:30:49Z")

</div>

hello, everyone, i have a need. how to calculate the closest distance between a control point and a model node? or here is two model node in the 3D view ,is there any good way to help me know which model did I choose with python code

---

<div class="post-metadata">

### Author: ![1023185654](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/1023185654/32/15829_2.png) [@1023185654](https://discourse.slicer.org/u/1023185654)
#### Post date: [September 8, 2022, 8:42am UTC](https://discourse.slicer.org/t/how-to-calculate-the-closest-distance-between-a-control-point-and-a-model-node/25151/2 "2022-09-08T08:42:44Z")

</div>

When click the mouse on 3D view, the selected model will be change the color , how do i achieve that?

---

<div class="post-metadata">

### Author: ![1023185654](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/1023185654/32/15829_2.png) [@1023185654](https://discourse.slicer.org/u/1023185654)
#### Post date: [September 9, 2022, 6:20am UTC](https://discourse.slicer.org/t/how-to-calculate-the-closest-distance-between-a-control-point-and-a-model-node/25151/3 "2022-09-09T06:20:36Z")

</div>

@lassoan , hope to get a reply
