<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Measure the distance between 2 co-ordinate systems in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12038018#M22471</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;I later realized doing that mistake&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;, anyways the problem is solved now. I am able to create a UCS using the matrix. Thank you so much for the reply.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2023 04:29:11 GMT</pubDate>
    <dc:creator>Saikiran_arakeri</dc:creator>
    <dc:date>2023-06-16T04:29:11Z</dc:date>
    <item>
      <title>Measure the distance between 2 co-ordinate systems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12029980#M22466</link>
      <description>&lt;P&gt;I am trying to measure the distance between 2 co-ordinate systems, I want the output to be in terms if X,Y &amp;amp; Z distances. I want this so that I can create a new co-ordinate system there at the that point and then Constrain both these CS's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7946284"&gt;@A.Acheson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 10:04:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12029980#M22466</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-06-13T10:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Measure the distance between 2 co-ordinate systems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12030255#M22467</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;.&amp;nbsp; What type of measurement do you need?&amp;nbsp; Is a simple, straight point to point distance OK?&amp;nbsp; If so, you can try something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oCM As CommandManager = ThisApplication.CommandManager
Dim UCS1 As UserCoordinateSystem = oCM.Pick(SelectionFilterEnum.kUserCoordinateSystemFilter, "Pick First UCS")
Dim UCS2 As UserCoordinateSystem = oCM.Pick(SelectionFilterEnum.kUserCoordinateSystemFilter, "Pick Second UCS")
Dim dDistance As Double = UCS1.Origin.Point.DistanceTo(UCS2.Origin.Point)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are both UCS's in the context of the top level of the 'active' assembly?&amp;nbsp; Or is one (or both) defined within sub assembly type components?&amp;nbsp; If one (or both) are defined down within components, then you may need to get the proxy version of them that is in the context of the top level assembly, so that you will be able to measure between them.&amp;nbsp; You mentioned creating a new UCS 'at that point'.&amp;nbsp; At what point?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 11:59:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12030255#M22467</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-06-13T11:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Measure the distance between 2 co-ordinate systems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12030335#M22468</link>
      <description>&lt;P&gt;Here is another example which includes X, Y, &amp;amp; Z data, as you requested.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oCM As CommandManager = ThisApplication.CommandManager
Dim UCS1 As UserCoordinateSystem = oCM.Pick(SelectionFilterEnum.kUserCoordinateSystemFilter, "Pick First UCS")
If UCS1 Is Nothing Then Exit Sub
Dim UCS2 As UserCoordinateSystem = oCM.Pick(SelectionFilterEnum.kUserCoordinateSystemFilter, "Pick Second UCS")
If UCS2 Is Nothing Then Exit Sub
Dim oOPt1 As Inventor.Point = UCS1.Origin.Point
Logger.Info("oOPt1.X = " &amp;amp; oOPt1.X &amp;amp; " oOPt1.Y = " &amp;amp; oOPt1.Y &amp;amp; " oOPt1.Z = " &amp;amp; oOPt1.Z)
Dim oOPt2 As Inventor.Point = UCS2.Origin.Point
Logger.Info("oOPt2.X = " &amp;amp; oOPt2.X &amp;amp; " oOPt2.Y = " &amp;amp; oOPt2.Y &amp;amp; " oOPt2.Z = " &amp;amp; oOPt2.Z)
Dim dMinDist As Double = oOPt1.DistanceTo(oOPt2)
Dim dXDiff As Double = (oOPt1.X - oOPt2.X)
Dim dYDiff As Double = (oOPt1.Y - oOPt2.Y)
Dim dZDiff As Double = (oOPt1.Z - oOPt2.Z)
MsgBox("Min. Distance = " &amp;amp; dMinDist _
&amp;amp; vbCrLf &amp;amp; "Positional Difference:" _
&amp;amp; vbCrLf &amp;amp; "X = " &amp;amp; dXDiff _
&amp;amp; vbCrLf &amp;amp; "Y = " &amp;amp; dYDiff _
&amp;amp; vbCrLf &amp;amp; "Z = " &amp;amp; dZDiff, vbInformation, "UCS to UCS Positional Difference")&lt;/LI-CODE&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt; ACCEPT SOLUTION &lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 12:27:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12030335#M22468</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-06-13T12:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Measure the distance between 2 co-ordinate systems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12035630#M22469</link>
      <description>&lt;P&gt;Thanks, that worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just needed a little help here,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a User Co-ordinate system in an assembly, I have used the code lines below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;otg = Invapp.TransientGeometry;&lt;/P&gt;&lt;P&gt;Gwp1 = Assydocdef.WorkPoints.AddFixed(otg.CreatePoint());&lt;BR /&gt;Gwp2 = Assemnlydocdef.WorkPoints.AddFixed(otg.CreatePoint());&lt;BR /&gt;Gwp3 = Assemblydocdef.WorkPoints.AddFixed(otg.CreatePoint());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GCSdef = Assemblydocdef.UserCoordinateSystems.CreateDefinition();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GCSdef.SetByThreePoints(Gwp1, Gwp2, Gwp3);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GCS = Assydocdef.UserCoordinateSystems.Add(GCSdef);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting an error in this line&amp;nbsp;GCS = Assydocdef.UserCoordinateSystems.Add(GCSdef);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please look into it?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 08:59:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12035630#M22469</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-06-15T08:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Measure the distance between 2 co-ordinate systems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12036727#M22470</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;.&amp;nbsp; In that code you just posted, I see that you are using two different variable names in multiple places for what seems to be an AssemblyComponentDefinition type object ("Assydocdef" &amp;amp; "Assemnlydocdef").&amp;nbsp; Are those both supposed to be representing the definition of the same assembly?&amp;nbsp; Why are you using two different variables?&amp;nbsp; If you are trying to create WorkPoints within two different assemblies, you will not be able to directly use all 3 WorkPoints directly to create one UCS in one of the assemblies.&amp;nbsp; All 3 WorkPoints will need to exist within the same 'context' (model origin 3D coordinate space).&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 15:55:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12036727#M22470</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-06-15T15:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Measure the distance between 2 co-ordinate systems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12038018#M22471</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;I later realized doing that mistake&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;, anyways the problem is solved now. I am able to create a UCS using the matrix. Thank you so much for the reply.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 04:29:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12038018#M22471</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-06-16T04:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Measure the distance between 2 co-ordinate systems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12038769#M22472</link>
      <description>&lt;P&gt;OK. Good to hear.&amp;nbsp; I didn't even think of this earlier, but the documentation tells us that the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=UserCoordinateSystemDefinition_SetByThreePoints" target="_blank" rel="noopener"&gt;UserCoordinateSystemDefinition.SetByThreePoints&lt;/A&gt; (and &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=UserCoordinateSystemDefinition_GetByThreePoints" target="_blank" rel="noopener"&gt;GetByThreePoints&lt;/A&gt;) methods will not work in assemblies.&amp;nbsp; What that documentation does not tell us is that those methods would not actually throw any errors themselves,&amp;nbsp; but later when you try to use a UCS definition that was defined that way in an assembly, the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=UserCoordinateSystems_Add" target="_blank" rel="noopener"&gt;Add method&lt;/A&gt; with throw an error.&amp;nbsp; It works OK in parts though.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 11:53:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/measure-the-distance-between-2-co-ordinate-systems/m-p/12038769#M22472</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-06-16T11:53:58Z</dc:date>
    </item>
  </channel>
</rss>

