<?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: how get coordinates AssemblyConstraint in Autodesk inventor API in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12022014#M22694</link>
    <description>&lt;P&gt;A simple way to solve this problem:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MeasureTools oMT = m_InvApp.MeasureTools;
UnitsOfMeasure oUOM = oAsmDoc.UnitsOfMeasure;
AssemblyConstraints oCstrs = oAsmDoc.ComponentDefinition.Constraints;
foreach (AssemblyConstraint oCstr in oCstrs)
{                
    if (oCstr.Type == ObjectTypeEnum.kMateConstraintObject)
    {
        WorkAxisProxy oAxis = null;
        try
        {
            oAxis = oCstr.EntityOne as WorkAxisProxy;
        }
        catch (Exception)
        {
            try
            {
                oAxis = oCstr.EntityTwo as WorkAxisProxy;
            }
            catch (Exception) { }
        }
        if (oAxis != null)
        {
            double dX, dY, dZ;
            dX = oUOM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.X, UnitsTypeEnum.kCentimeterLengthUnits, oUOM.LengthUnits);
            dY = oUOM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.Y, UnitsTypeEnum.kCentimeterLengthUnits, oUOM.LengthUnits);
            dZ = oUOM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.Z, UnitsTypeEnum.kCentimeterLengthUnits, oUOM.LengthUnits);
            MessageBox.Show("X: " + dX + "\nY: " + dY + "\nZ: " + dZ, oCstr.Name);
        }
    }
}&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 09 Jun 2023 06:00:17 GMT</pubDate>
    <dc:creator>Andrii_Humeniuk</dc:creator>
    <dc:date>2023-06-09T06:00:17Z</dc:date>
    <item>
      <title>how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12017248#M22687</link>
      <description>&lt;P&gt;Greetings. I wanted to ask if there is any way to get the coordinates of the middle point of the constraint as in the figure?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="09241ac8-6d02-4c96-80c7-1a5a7104aa59.jpg" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1224621i551CC84C4D0C7679/image-size/medium?v=v2&amp;amp;px=400" role="button" title="09241ac8-6d02-4c96-80c7-1a5a7104aa59.jpg" alt="09241ac8-6d02-4c96-80c7-1a5a7104aa59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:30:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12017248#M22687</guid>
      <dc:creator>kkk_rbhbkkk</dc:creator>
      <dc:date>2023-06-08T12:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12017510#M22688</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;You can simply measure the distance of the cylinder (axis) from any construction plane (assuming the plane and axis are parallel, of course).&lt;BR /&gt;Do you have something else in mind?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 14:05:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12017510#M22688</guid>
      <dc:creator>kacper.suchomski</dc:creator>
      <dc:date>2023-06-07T14:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020079#M22689</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I apologize. You must have misunderstood. I have an assembly that was not created by me. I need to find the coordinates of all the x,y,z points where the parts of this assembly were connected. Using the Autodesk Inventor API&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:29:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020079#M22689</guid>
      <dc:creator>kkk_rbhbkkk</dc:creator>
      <dc:date>2023-06-08T12:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020258#M22690</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14021738"&gt;@kkk_rbhbkkk&lt;/a&gt;&amp;nbsp;.&amp;nbsp;This is an example of how to get axis coordinates in MateConstraint:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Private Sub Main()
	Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument	
	Dim oMT As MeasureTools = ThisApplication.MeasureTools
	Dim oUOfM As UnitsOfMeasure = oDoc.UnitsOfMeasure
	Dim oCstrs As AssemblyConstraints = oDoc.ComponentDefinition.Constraints
	For Each oCstr As AssemblyConstraint In oCstrs
		If oCstr.Type = ObjectTypeEnum.kMateConstraintObject Then
			Dim oAxis As WorkAxisProxy
			If oCstr.EntityOne.Type = ObjectTypeEnum.kWorkAxisProxyObject Then
				oAxis = oCstr.EntityOne
			Else If oCstr.EntityTwo.Type = ObjectTypeEnum.kWorkAxisProxyObject Then
				oAxis = oCstr.EntityTwo
			End If
			If oAxis IsNot Nothing Then		
				Dim dX, dY, dZ As Double
				dX = Abs(oUOfM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.X, kCentimeterLengthUnits, oUOfM.LengthUnits))
				dY = Abs(oUOfM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.Y, kCentimeterLengthUnits, oUOfM.LengthUnits))
				dZ = Abs(oUOfM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.Z, kCentimeterLengthUnits, oUOfM.LengthUnits))
				MessageBox.Show("X - " &amp;amp; dX &amp;amp; vbLf &amp;amp; _
								"Y - " &amp;amp; dY &amp;amp; vbLf &amp;amp; _
								"Z - " &amp;amp; dZ &amp;amp; vbLf, oCstr.Name)
			End If
		End If
	Next
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 13:28:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020258#M22690</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-06-08T13:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020658#M22691</link>
      <description>&lt;P&gt;Thank you. Is this method suitable for other types of constraints?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 15:39:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020658#M22691</guid>
      <dc:creator>kkk_rbhbkkk</dc:creator>
      <dc:date>2023-06-08T15:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020682#M22692</link>
      <description>&lt;P&gt;This method is suitable for any cases, if it is adjusted. In this case it is set to look for a &lt;STRONG&gt;MateConstraint&lt;/STRONG&gt;, and if it has at least one axis it measures relative to the center of the assembly as per your question and the screenshot.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If the answer was useful for you and solved your question, please mark it as "&lt;STRONG&gt;SOLUTION&lt;/STRONG&gt;", it will be useful for other users. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 15:48:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020682#M22692</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-06-08T15:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020952#M22693</link>
      <description>Sorry. I probably misunderstood something, but when migrating to C#, I get errors. EntityOne has no Type property. And from the code we get coordinates abs, although relative to general coordinates the constraint can be in negative coordinates</description>
      <pubDate>Thu, 08 Jun 2023 17:35:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12020952#M22693</guid>
      <dc:creator>kkk_rbhbkkk</dc:creator>
      <dc:date>2023-06-08T17:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12022014#M22694</link>
      <description>&lt;P&gt;A simple way to solve this problem:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MeasureTools oMT = m_InvApp.MeasureTools;
UnitsOfMeasure oUOM = oAsmDoc.UnitsOfMeasure;
AssemblyConstraints oCstrs = oAsmDoc.ComponentDefinition.Constraints;
foreach (AssemblyConstraint oCstr in oCstrs)
{                
    if (oCstr.Type == ObjectTypeEnum.kMateConstraintObject)
    {
        WorkAxisProxy oAxis = null;
        try
        {
            oAxis = oCstr.EntityOne as WorkAxisProxy;
        }
        catch (Exception)
        {
            try
            {
                oAxis = oCstr.EntityTwo as WorkAxisProxy;
            }
            catch (Exception) { }
        }
        if (oAxis != null)
        {
            double dX, dY, dZ;
            dX = oUOM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.X, UnitsTypeEnum.kCentimeterLengthUnits, oUOM.LengthUnits);
            dY = oUOM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.Y, UnitsTypeEnum.kCentimeterLengthUnits, oUOM.LengthUnits);
            dZ = oUOM.ConvertUnits(oAxis.Line.Evaluator.RangeBox.MinPoint.Z, UnitsTypeEnum.kCentimeterLengthUnits, oUOM.LengthUnits);
            MessageBox.Show("X: " + dX + "\nY: " + dY + "\nZ: " + dZ, oCstr.Name);
        }
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 06:00:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12022014#M22694</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-06-09T06:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: how get coordinates AssemblyConstraint in Autodesk inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12022601#M22695</link>
      <description>&lt;P&gt;Hello, this method is not correct because&amp;nbsp;oAxis = oCstr.EntityOne as WorkAxisProxy Is always an object of the kFaceProxyObject class. And when I try to transfer them to WorkAxisProxy I get an error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kkk_rbhbkkk_0-1686310810740.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1225496iD05F8A3D7DBBF21B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kkk_rbhbkkk_0-1686310810740.png" alt="kkk_rbhbkkk_0-1686310810740.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 11:40:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-get-coordinates-assemblyconstraint-in-autodesk-inventor-api/m-p/12022601#M22695</guid>
      <dc:creator>kkk_rbhbkkk</dc:creator>
      <dc:date>2023-06-09T11:40:22Z</dc:date>
    </item>
  </channel>
</rss>

