<?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 Retrieve dimension does not work in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8403704#M91437</link>
    <description>&lt;P&gt;I need to retrieve specific dimensions using GeneralDimensions.Retrieve function.&lt;/P&gt;&lt;P&gt;But when collection of specific object of dimensions is sent as variable in the function, it retrieves all the dimensions between any two specific dimensions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For e.g If dimension[1] and dimension[10] is to be retrieved and an object collection of these two dimension is sent as variable, the function retrieves dimensions from dimension[1] to dimension[10].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any solution to it?&lt;/P&gt;&lt;P&gt;Thanks in advance&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;PRE&gt;                ObjectCollection retrievableDimensions = activeSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(targetView);&lt;BR /&gt;                ObjectCollection Finaldimensions = activeSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(targetView);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finaldimensions.Clear();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finaldimensions.Add(retrievableDimensions[1]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finaldimensions.Add(retrievableDimensions[10]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retirevedDiemsions = activeSheet.DrawingDimensions.GeneralDimensions.Retrieve(targetView,Finaldimensions);&lt;BR /&gt;
&lt;/PRE&gt;</description>
    <pubDate>Thu, 15 Nov 2018 10:33:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-15T10:33:23Z</dc:date>
    <item>
      <title>Retrieve dimension does not work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8403704#M91437</link>
      <description>&lt;P&gt;I need to retrieve specific dimensions using GeneralDimensions.Retrieve function.&lt;/P&gt;&lt;P&gt;But when collection of specific object of dimensions is sent as variable in the function, it retrieves all the dimensions between any two specific dimensions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For e.g If dimension[1] and dimension[10] is to be retrieved and an object collection of these two dimension is sent as variable, the function retrieves dimensions from dimension[1] to dimension[10].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any solution to it?&lt;/P&gt;&lt;P&gt;Thanks in advance&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;PRE&gt;                ObjectCollection retrievableDimensions = activeSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(targetView);&lt;BR /&gt;                ObjectCollection Finaldimensions = activeSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(targetView);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finaldimensions.Clear();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finaldimensions.Add(retrievableDimensions[1]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finaldimensions.Add(retrievableDimensions[10]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retirevedDiemsions = activeSheet.DrawingDimensions.GeneralDimensions.Retrieve(targetView,Finaldimensions);&lt;BR /&gt;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Nov 2018 10:33:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8403704#M91437</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-15T10:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve dimension does not work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8412549#M91577</link>
      <description>&lt;P&gt;Can you attach the data(don't attach confidential data) to reproduce the problem?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 07:08:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8412549#M91577</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2018-11-20T07:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve dimension does not work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8418093#M91637</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/532715"&gt;@YuhanZhang&lt;/a&gt; thank you for your response&lt;/P&gt;
&lt;P&gt;You can use any part model with drawing to test just use the below code and You will get set of dimensions in drawing instead of just the two dimensions which was specified in dimensions object collection&lt;/P&gt;
&lt;PRE&gt;ObjectCollection retrievableDimensions = activeSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(Viewobject);
// to get all the retreivable dimensions
                ObjectCollection Finaldimensions = activeSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(Viewobject);
                Finaldimensions.Clear();
                Finaldimensions.Add(retrievableDimensions[1]);
                Finaldimensions.Add(retrievableDimensions[10]);
// here we add two specific dimensions in the object collection that is to be retrieved.
                retirevedDiemsions = activeSheet.DrawingDimensions.GeneralDimensions.Retrieve(Viewobject,Finaldimensions);
// here the dimensions are retrieved&lt;/PRE&gt;
&lt;P&gt;Awaiting your reply.&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 07:21:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8418093#M91637</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-22T07:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve dimension does not work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8419745#M91662</link>
      <description>&lt;P&gt;I tested with the code already and can't reproduce the problem, so it is better you provide a data(don't send us confidential data)&amp;nbsp;that can reproduce the&amp;nbsp;problem for us or capture a video for us to know where the problem happens.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 02:31:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8419745#M91662</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2018-11-23T02:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve dimension does not work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8421617#M91671</link>
      <description>&lt;P&gt;You can find Test models and drawings attached for testing purpose.&lt;/P&gt;
&lt;P&gt;First test was to retrieve first and last dimension of first occurencein an assembly which worked fine&lt;/P&gt;
&lt;P&gt;Second test includes retreival of first dimensions of both the occurence which in result retrieved all the dimensions of first occurence and first dimension of second occurence.&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="test1_code.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/573136iE6D1DF7C82C1022C/image-size/large?v=v2&amp;amp;px=999" role="button" title="test1_code.png" alt="test1_code.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test1_result.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/573138i79AFA9839D22274B/image-size/large?v=v2&amp;amp;px=999" role="button" title="test1_result.JPG" alt="test1_result.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test2_code.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/573139i689F3B861217E430/image-size/large?v=v2&amp;amp;px=999" role="button" title="test2_code.png" alt="test2_code.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test2_result.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/573137iC49F320329D0DA82/image-size/large?v=v2&amp;amp;px=999" role="button" title="test2_result.JPG" alt="test2_result.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//using InvConnectLib;
using Mapper;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Inventor;
using System.Runtime.InteropServices;

namespace TestingInvLib
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Inventor.Application Iapp = Marshal.GetActiveObject("Inventor.Application") as Inventor.Application;

                String filePath = @"D:\Forum\assembly_drawing.idw";

                //Test 1 is for retreiving first and last dimension of first occurance in that view1
                Test1(Iapp,filePath);

                //Test 2 is for retreiving first dimension of first occurance and first dimension of second occurance in that view1
                Test2(Iapp, filePath);

            }
            catch (Exception ex) { Console.WriteLine(ex.Message);Console.WriteLine(ex.Source);Console.ReadLine(); }
        }

        private static void Test1(Inventor.Application Iapp, String filePath)
        {
            DrawingDocument drawing = Iapp.Documents.Open(filePath) as DrawingDocument;
            Sheet activeSheet = (Sheet)drawing.ActiveSheet;
            DrawingView targetView = activeSheet.DrawingViews[1]; //the first view named VIEW1

            ObjectCollection retrievableDimen = activeSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(targetView);

            ObjectCollection diminsionToRetrieve = Iapp.TransientObjects.CreateObjectCollection();
            diminsionToRetrieve.Add(retrievableDimen[1]);
            diminsionToRetrieve.Add(retrievableDimen[6]);

            GeneralDimensionsEnumerator retirevedDiemsions = 
                activeSheet.DrawingDimensions.GeneralDimensions.Retrieve(targetView, diminsionToRetrieve);

            int retrieveCount = retirevedDiemsions.Count;
        }

        private static void Test2(Inventor.Application Iapp, String filePath)
        {
            DrawingDocument drawing = Iapp.Documents.Open(filePath) as DrawingDocument;
            Sheet activeSheet = (Sheet)drawing.ActiveSheet;
            DrawingView targetView = activeSheet.DrawingViews[1]; //the first view named VIEW1

            ObjectCollection retrievableDimen = activeSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(targetView);

            ObjectCollection diminsionToRetrieve = Iapp.TransientObjects.CreateObjectCollection();
            diminsionToRetrieve.Add(retrievableDimen[1]);
            diminsionToRetrieve.Add(retrievableDimen[7]);

            GeneralDimensionsEnumerator retirevedDiemsions =
                activeSheet.DrawingDimensions.GeneralDimensions.Retrieve(targetView, diminsionToRetrieve);

            int retrieveCount = retirevedDiemsions.Count;
        }
    }
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Awaiting your reply.&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 24 Nov 2018 05:37:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8421617#M91671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-24T05:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve dimension does not work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8426231#M91765</link>
      <description>&lt;P&gt;Hi, I tested your code with your data in Inventor 2017.4, 2018.2 and 2019 and can't reproduce the problem at all. I see your data was saved in "2017 (Build 210142000, 142)" , can you update your product to latest Inventor 2017 version to see if the problem is solved there? You can find the updates from your Autodesk accounts:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://manage.autodesk.com" target="_blank"&gt;https://manage.autodesk.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me if you update to Inventor 2017.4 if the problem still exists?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 02:54:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8426231#M91765</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2018-11-27T02:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve dimension does not work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8432759#M91855</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/532715"&gt;@YuhanZhang&lt;/a&gt; Yes updating it to latest version solved the issue.&lt;/P&gt;
&lt;P&gt;Thanks a lot!!!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 10:43:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8432759#M91855</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-29T10:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve dimension does not work</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8432760#M91856</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/532715"&gt;@YuhanZhang&lt;/a&gt; Yes updating it to latest version solved the issue.&lt;/P&gt;
&lt;P&gt;Thanks a lot!!1&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 10:44:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/retrieve-dimension-does-not-work/m-p/8432760#M91856</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-29T10:44:12Z</dc:date>
    </item>
  </channel>
</rss>

