<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Determine distance between bones and Antenna]]></title><description><![CDATA[<p dir="auto">Hi, I would like to calculate the distance between an antenna and the bone surface perpendicular to the antenna. What would be the best way to approach this?</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.zmt.swiss/topic/505/determine-distance-between-bones-and-antenna</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 05:11:07 GMT</lastBuildDate><atom:link href="https://forum.zmt.swiss/topic/505.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Dec 2022 11:48:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Determine distance between bones and Antenna on Tue, 20 May 2025 14:52:05 GMT]]></title><description><![CDATA[<p dir="auto">To measure the shortest distance between two entities, you can use the Python API:</p>
<pre><code class="language-py">import XCoreModeling as xcm


shell = xcm.GetActiveModel().SelectedEntities[0]
coil = xcm.GetActiveModel().SelectedEntities[1]

res = xcm.GetEntityEntityDistance(shell, coil)
print(f"Shortest distance shell-coil: {res[0].Distance}")

p1 = xcm.CreatePoint(res[0].ClosestPosition)
p1.Name = "Point on Shell"

p2 = xcm.CreatePoint(res[1].ClosestPosition)
p2.Name = "Point on Coil"

# This line is just to visualize where the measured distance was taken
line = xcm.CreatePolyLine([res[0].ClosestPosition, res[1].ClosestPosition])
</code></pre>
<p dir="auto">This would create something like this:<br />
<img src="/assets/uploads/files/1747752108672-c17b7bff-2d64-408c-88a7-fd83a4dadfdb-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Some other snippets are shared here: <a href="https://forum.zmt.swiss/topic/565/geometry-modeling-snapping-to-endpoints-in-python-api/3?_=1747746585465">https://forum.zmt.swiss/topic/565/geometry-modeling-snapping-to-endpoints-in-python-api/3?_=1747746585465</a></p>
]]></description><link>https://forum.zmt.swiss/post/2163</link><guid isPermaLink="true">https://forum.zmt.swiss/post/2163</guid><dc:creator><![CDATA[bryn]]></dc:creator><pubDate>Tue, 20 May 2025 14:52:05 GMT</pubDate></item></channel></rss>