<?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: Document.ReferenceKeyManager.BindKeyToObject trouble in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/9035605#M140543</link>
    <description>&lt;P&gt;I have the exact same problem tried the workaround it didn't fix the problem for me. Please fix this soon I've already wasted three hours trying to get around this issue.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2019 17:25:31 GMT</pubDate>
    <dc:creator>dylanTEV9W</dc:creator>
    <dc:date>2019-09-19T17:25:31Z</dc:date>
    <item>
      <title>Document.ReferenceKeyManager.BindKeyToObject trouble</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/3027210#M140540</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;Fighting with the transient nature of faces I ran in to a few probs trying to use the API documentation on the ReferenceKeyManager Interface, that seems a little out of touch regarding parameters. This is my best go trying to implement the example from the docs into C# in an iteration over 6 faces that changes. The actual parameters seems to differ from the documentation, thus a few code changes, but this  works fine through the first iteration, but breaks when the number of faces change after the first iteration &amp;amp; then calling the &lt;/FONT&gt;&lt;FONT size="1" face="arial,helvetica,sans-serif"&gt;BindKeyToObject giving me an argumentexception : Parameter is incorrect. The keyContext seems to be dynamic, but I asume that´s how it´s supposed to be. &lt;/FONT&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;myDoc &amp;amp; myComp are trivial, &amp;amp; the solutionnature is unique also in the iteration that breaks. As I understand this should be the correct procedure to reference faces that change.&lt;BR /&gt;Any clues? Thx in advance!  (  WIN 7 64b, INV 2010, VS C# 2010 )&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;FONT face="courier new,courier"&gt;List&amp;lt;byte[]&amp;gt; refKeys = new List&amp;lt;byte[]&amp;gt;();
List&amp;lt;byte[]&amp;gt; contextDatas = new List&amp;lt;byte[]&amp;gt;();
for (int i = 1; i &amp;lt;= 6; i++)
{
   byte[] refKey = new byte[0];
   byte[] contextData = new byte[0];
   int keyContext = myDoc.ReferenceKeyManager.CreateKeyContext();
   myComp.SurfaceBodies[1].Faces[i].GetReferenceKey(ref refKey, keyContext);
   myDoc.ReferenceKeyManager.SaveContextToArray(keyContext, ref contextData);
   refKeys.Add(refKey);
   contextDatas.Add(contextData);&lt;BR /&gt;}
for (int i = 0; i &amp;lt;= 5; i++)&lt;BR /&gt;{
   byte[] contextData = contextDatas[i];
   byte[] refKey = refKeys[i];
   int keyContext = myDoc.ReferenceKeyManager.LoadContextFromArray(ref contextData);
   object solutionnature;
   Face theFace = (Face)myDoc.ReferenceKeyManager.BindKeyToObject(ref refKey, keyContext, out solutionnature);

// CODE THAT MAKES A SKETCH DEFINED BY THE FACE &amp;amp; MAKES A FEATURE THAT CHANGES THE FACE&lt;BR /&gt;&amp;nbsp;}&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2011 19:41:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/3027210#M140540</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-17T19:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ReferenceKeyManager.BindKeyToObject trouble</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/3032748#M140541</link>
      <description>&lt;P&gt;Well after a weeks try &amp;amp; error &amp;amp; patiently waiting for a reply on this thread I found the solution by chance &amp;amp; would like to share it with anybody stuck in C#, inv2010, Breps and an outdated API documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT face="courier new,courier"&gt;object solutionnature = null;&lt;/FONT&gt;&lt;/FONT&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2011 11:34:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/3032748#M140541</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-23T11:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ReferenceKeyManager.BindKeyToObject trouble</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/8786219#M140542</link>
      <description>&lt;P&gt;Thanks for the reporting and workaround! We've received your problem report and accepted it as an internal bug INVGEN-28967.&amp;nbsp; Will let you know once there is any update for it.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 02:41:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/8786219#M140542</guid>
      <dc:creator>JarFu</dc:creator>
      <dc:date>2019-05-13T02:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Document.ReferenceKeyManager.BindKeyToObject trouble</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/9035605#M140543</link>
      <description>&lt;P&gt;I have the exact same problem tried the workaround it didn't fix the problem for me. Please fix this soon I've already wasted three hours trying to get around this issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 17:25:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/document-referencekeymanager-bindkeytoobject-trouble/m-p/9035605#M140543</guid>
      <dc:creator>dylanTEV9W</dc:creator>
      <dc:date>2019-09-19T17:25:31Z</dc:date>
    </item>
  </channel>
</rss>

