<?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 Betreff: Inventor Api: find Connection between Sketch Dimension(DimensionConstraint) and Model Dimension(LinearModelDimension) in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10749827#M131125</link>
    <description>&lt;P&gt;With Inventor 2022.2 update it's now possible to use "Promoteparameter". tested it and it works fine &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="theobot_0-1636611328857.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/988414i06A2016A408F8A22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="theobot_0-1636611328857.png" alt="theobot_0-1636611328857.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Nov 2021 06:17:25 GMT</pubDate>
    <dc:creator>theo.bot</dc:creator>
    <dc:date>2021-11-11T06:17:25Z</dc:date>
    <item>
      <title>Inventor Api: find Connection between Sketch Dimension(DimensionConstraint) and Model Dimension(LinearModelDimension)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10724892#M130705</link>
      <description>&lt;P&gt;Hallo,&amp;nbsp;&lt;/P&gt;&lt;P&gt;since Inventor 22 it is possible to promote SketchDimensions via code. See &lt;A title="-promote-model-dimensions-to-3d-annotations" href="https://forums.autodesk.com/t5/inventor-ideas/api-support-to-promote-model-dimensions-to-3d-annotations/idc-p/10566026#M42927" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Holzethekid_2-1635603755987.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/983821iEBFB5BA58A74A4EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Holzethekid_2-1635603755987.png" alt="Holzethekid_2-1635603755987.png" /&gt;&lt;/span&gt;via UI&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Model Dimensions promoted via 'Inventor' has the great feature that if i change an value in the sketch the value in the Model Value will change to.&lt;/P&gt;&lt;P&gt;Manuell created Model Dimensions do not have this feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Assume that the Sketch Dimension (&lt;A href="https://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-7CDE8986-36C4-4AC6-B88B-55481AD3AD5D" target="_blank" rel="noopener"&gt;DimensionConstaint&lt;/A&gt;) and the Model Dimension (&lt;A href="https://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-98C86F9F-6A99-43BD-B9C2-4BF580D68F69" target="_blank" rel="noopener"&gt;ModelDimension&lt;/A&gt;) are somehow connected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Holzethekid_0-1635603447044.png" style="width: 217px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/983815iB6E0BBB481A81B02/image-dimensions/217x138?v=v2" width="217" height="138" role="button" title="Holzethekid_0-1635603447044.png" alt="Holzethekid_0-1635603447044.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Holzethekid_1-1635603460503.png" style="width: 157px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/983816iAE2615A3B3DE4951/image-dimensions/157x144?v=v2" width="157" height="144" role="button" title="Holzethekid_1-1635603460503.png" alt="Holzethekid_1-1635603460503.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was checking the documentation, but i did not find any connection between the two objects.&lt;/P&gt;&lt;P&gt;Can somebody help me to find the connection between these objects, or how can i find out if one DimensionConstraint is already promoted and get the object ?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 14:23:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10724892#M130705</guid>
      <dc:creator>Holzethekid</dc:creator>
      <dc:date>2021-10-30T14:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Api: find Connection between Sketch Dimension(DimensionConstraint) and Model Dimension(LinearModelDimension)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10727421#M130743</link>
      <description>&lt;P&gt;Within the Modeldimensiondefinition you can find the promoted parameter. But for some reason i can't get the parameter. It results in a "not implemented" message. Maybe someone else knows how to deal with this.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
    
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oDef&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oModelDim&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ModelDimension&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oModelDim&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;ModelAnnotations&lt;/SPAN&gt;.&lt;SPAN&gt;ModelDimensions&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oModelDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ModelDimensionDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPara&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Parameter&lt;/SPAN&gt;
&lt;SPAN&gt;oModelDef&lt;/SPAN&gt; = &lt;SPAN&gt;oModelDim&lt;/SPAN&gt;.&lt;SPAN&gt;Definition&lt;/SPAN&gt;
&lt;SPAN&gt;oPara&lt;/SPAN&gt; = &lt;SPAN&gt;oModelDef&lt;/SPAN&gt;.&lt;SPAN&gt;PromoteParameter&lt;/SPAN&gt;
&lt;SPAN&gt;Logger&lt;/SPAN&gt;.&lt;SPAN&gt;Info&lt;/SPAN&gt;(&lt;SPAN&gt;oPara&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;)
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="theobot_0-1635756635702.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/984226i31C78DC5AC66E4B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="theobot_0-1635756635702.png" alt="theobot_0-1635756635702.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 09:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10727421#M130743</guid>
      <dc:creator>theo.bot</dc:creator>
      <dc:date>2021-11-01T09:33:18Z</dc:date>
    </item>
    <item>
      <title>Betreff: Inventor Api: find Connection between Sketch Dimension(DimensionConstraint) and Model Dimension(LinearModelDimension)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10731119#M130820</link>
      <description>&lt;P&gt;Hall Theo,&lt;/P&gt;&lt;P&gt;thanks for the anwer. But as you mentioned the 'PromoteParameter' does not work.&lt;/P&gt;&lt;P&gt;I 'found' a&amp;nbsp; really sketchy solution how to identify a annotation depending on a DimensionConstraint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess that this solution will be very easy to break, and if the other objects&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;nbsp;RadiusModelDimensions&lt;/P&gt;&lt;P&gt;-&amp;nbsp;DiameterModelDimensions&lt;/P&gt;&lt;P&gt;-&amp;nbsp;AngularModelDimensions&lt;/P&gt;&lt;P&gt;will work the same way ?? I don't know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;  public ModelAnnotation GetConnectedAnnotation(DimensionConstraint constraint)
        {
            logger.Debug($"GetConnectedAnnotation");

            var annotations = applicationService.GetDocumentAnnotations();

            foreach (var md in annotations.ModelDimensions)
            {
                if (md is LinearModelDimension modelDimension)
                {
                    if (modelDimension.Definition is LinearModelDimensionDefinition lmdd)
                    {
                        if (lmdd.IntentOne.Geometry is SketchPoint sp)
                        {
                            foreach (var point in constraint.AnchorPoints)
                            {
                                if (point is Point2d point2d)
                                {
                                    if (sp.Geometry.IsEqualTo(point2d))
                                    {
                                        if (Math.Abs(constraint._DisplayValue - modelDimension.ModelValue) &amp;lt;= 0)
                                        {
                                            logger.Debug($"found constraint : {constraint.Parameter.Name} Value:'{constraint.Parameter.Expression}' | modelDimesnion{modelDimension.Name} Value :'{modelDimension.ModelValue}'");
                                            return md as ModelAnnotation;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return null;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 20:02:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10731119#M130820</guid>
      <dc:creator>Holzethekid</dc:creator>
      <dc:date>2021-11-02T20:02:19Z</dc:date>
    </item>
    <item>
      <title>Betreff: Inventor Api: find Connection between Sketch Dimension(DimensionConstraint) and Model Dimension(LinearModelDimension)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10749827#M131125</link>
      <description>&lt;P&gt;With Inventor 2022.2 update it's now possible to use "Promoteparameter". tested it and it works fine &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="theobot_0-1636611328857.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/988414i06A2016A408F8A22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="theobot_0-1636611328857.png" alt="theobot_0-1636611328857.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 06:17:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-api-find-connection-between-sketch-dimension/m-p/10749827#M131125</guid>
      <dc:creator>theo.bot</dc:creator>
      <dc:date>2021-11-11T06:17:25Z</dc:date>
    </item>
  </channel>
</rss>

