<?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: Modifying files with ModelStates via Apprentice not possible in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12238769#M157680</link>
    <description>&lt;P&gt;You might want to read this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/manufacturing/2022/05/porting-guide-from-level-of-details-to-model-states.html" target="_blank"&gt;https://adndevblog.typepad.com/manufacturing/2022/05/porting-guide-from-level-of-details-to-model-states.html&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;just some quotes:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The ApprenticeServerDocument.PropertySets currently just return the iProperty of the active model state, and the model state level iProperty is regarded as the model data so Apprentice can’t edit at present.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If you want to edit the iProperty of a custom model state, it is recommended to use Inventor Server or Inventor instead.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Any Inventor 2022 part with an added model state causes IsModifiable value to be true and prevents any updates of iproperties with apprentice server.&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 22:05:24 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2023-09-13T22:05:24Z</dc:date>
    <item>
      <title>Modifying files with ModelStates via Apprentice not possible</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12237879#M157660</link>
      <description>&lt;P&gt;We have been using an Excel/VBA copy-tool to copy drawings with Apprentice Server for many years. This tool automates many tasks including changing iProperties and updating links.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since we upgraded Inventor last week from 2020 to 2024 we get an error whenever we try to use this tool on assemblies that have got ModelStates. Error example: "Error -2147467259 (80004005) Method Value of object Property failed".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;During debugging I can see that&amp;nbsp;&lt;EM&gt;IsModifiable&lt;/EM&gt; is &lt;EM&gt;False&lt;/EM&gt; (in Apprentice). When I remove the extra Model States in Inventor, save the file, and open it again with Apprentice, I can see that&amp;nbsp;&lt;EM&gt;IsModifiable&lt;/EM&gt; has changed to &lt;EM&gt;True&lt;/EM&gt;. Therefore I assume the Model State is responsible for the errors we are getting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are similar posts on the forum with this problem, but I haven't seen a solution that works for us. One of the proposed solutions mentions setting &lt;EM&gt;Toggle Edit Scope&lt;/EM&gt;&amp;nbsp;to &lt;EM&gt;Factory Scope&lt;/EM&gt;. I can't do this, the only available options are &lt;EM&gt;kEditAllMembers&lt;/EM&gt;&amp;nbsp;and &lt;EM&gt;kEditAllMembers&lt;/EM&gt;. I did try to change &lt;EM&gt;Toggle Edit Scope&lt;/EM&gt;&amp;nbsp;to &lt;EM&gt;All Model States&lt;/EM&gt; in Inventor, but with no success, in Apprentice &lt;EM&gt;IsModifiable&lt;/EM&gt;&amp;nbsp;remains&amp;nbsp;&lt;EM&gt;False &lt;/EM&gt;and&amp;nbsp;the error also remains.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surprisingly Design Assistant doesn't have any issues with Model States. I have tried different situations (with/without ModelStates, Primary active/Custom active, All Model States active/Model State Only active) and every time it is possible to edit iProperties with Design Assistant. This makes me think there is a solution possible, I just haven't found it yet, and I could use some help on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we overcome this issue and make it possible again to use our&amp;nbsp;Excel/VBA copy-tool on files with Model States?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a workaround the tool now skips files with ModelStates, which means manually changing iProperties and exchanging links, but this is a very undesirable situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Niels&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 19:45:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12237879#M157660</guid>
      <dc:creator>nboelens</dc:creator>
      <dc:date>2023-09-13T19:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying files with ModelStates via Apprentice not possible</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12238769#M157680</link>
      <description>&lt;P&gt;You might want to read this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/manufacturing/2022/05/porting-guide-from-level-of-details-to-model-states.html" target="_blank"&gt;https://adndevblog.typepad.com/manufacturing/2022/05/porting-guide-from-level-of-details-to-model-states.html&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;just some quotes:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The ApprenticeServerDocument.PropertySets currently just return the iProperty of the active model state, and the model state level iProperty is regarded as the model data so Apprentice can’t edit at present.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If you want to edit the iProperty of a custom model state, it is recommended to use Inventor Server or Inventor instead.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Any Inventor 2022 part with an added model state causes IsModifiable value to be true and prevents any updates of iproperties with apprentice server.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 22:05:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12238769#M157680</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2023-09-13T22:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying files with ModelStates via Apprentice not possible</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12240730#M157751</link>
      <description>&lt;P&gt;Thank you for the link, this clarifies some of the question I had.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing&amp;nbsp;&lt;STRONG&gt;PropertySets&lt;/STRONG&gt; to&amp;nbsp;&lt;STRONG&gt;FilePropertySets &lt;/STRONG&gt;fixed the error messages we got. Our copy-tool can be used again, but unfortunately updating the iProperties appears not to be possible anymore when a ModelState is present.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still somewhat confused about the explanation they give about editing iProperties (see below). It seems the 2022.1 update made it possible to edit the iProperties again, but even with the FilePropertySets object the changes I make are not saved to the iProperties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;A new API&amp;nbsp;&lt;STRONG&gt;ApprenticeServerDocument.FilePropertySets&lt;/STRONG&gt;&amp;nbsp;is exposed in Inventor 2022.1 release, and this FilePropertySets is File level iProperty, and it will return the same property values as the iProperty of master model state, and you can also change the property values in FilePropertySet.&amp;nbsp; If you want to edit the iProperty of a custom model state, it is recommended to use Inventor Server or Inventor instead.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;The legacy&amp;nbsp;&lt;STRONG&gt;ApprenticeServerDocument.PropertySets&lt;/STRONG&gt;&amp;nbsp;does not work in ApprenticeServer anymore when there is custom model state, and in Inventor 2022.1 we introduced a new&amp;nbsp;&lt;STRONG&gt;ApprenticeServerDocument.FilePropertySets&lt;/STRONG&gt;&amp;nbsp;instead, so you should make use of the new API to update the file level iProperties.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 15:33:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12240730#M157751</guid>
      <dc:creator>nboelens</dc:creator>
      <dc:date>2023-09-14T15:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying files with ModelStates via Apprentice not possible</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12240793#M157754</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1082578"&gt;@nboelens&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;A new API&amp;nbsp;&lt;STRONG&gt;ApprenticeServerDocument.FilePropertySets&lt;/STRONG&gt;&amp;nbsp;is exposed in Inventor 2022.1 release, and this FilePropertySets is File level iProperty, and it will return the same property values as the iProperty of &lt;FONT face="arial black,avant garde" color="#0000FF"&gt;master model state&lt;/FONT&gt;, and you can also change the property values in FilePropertySet.&amp;nbsp; &lt;FONT color="#FF0000"&gt;If you want to edit the iProperty of a custom model state, it is recommended to use Inventor Server or Inventor instead.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 15:56:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12240793#M157754</guid>
      <dc:creator>Frederick_Law</dc:creator>
      <dc:date>2023-09-14T15:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying files with ModelStates via Apprentice not possible</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12256386#M158051</link>
      <description>&lt;P&gt;Thank you for bringing the Master model state to my attention. This led me to the solution for storing the iProperties with Apprentice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After using &lt;STRONG&gt;&lt;EM&gt;FilePropertySets&lt;/EM&gt;&lt;/STRONG&gt; instead of &lt;STRONG&gt;&lt;EM&gt;PropertySets&lt;/EM&gt;&lt;/STRONG&gt; everything seemed to work as before, except the edited iProperties were not save to the document. I have now added &lt;STRONG&gt;&lt;EM&gt;oApprDoc.FilePropertySets.FlushToFile&lt;/EM&gt;&lt;/STRONG&gt; to write the changed iProperties to the file and this solved the last issue I had with saving the changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand it correctly there now is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Model State Factory Document (a.k.a. master model state / primary model state) which iProperties can be read and written with Apprentice via FilePropertySets + FlushToFile&lt;/LI&gt;&lt;LI&gt;Model State Member Document(s) (a.k.a. custom model state) which iProperties can only be read with Apprentice via PropertySets, and only the currently active ModelState is visible.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 21 Sep 2023 13:37:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12256386#M158051</guid>
      <dc:creator>nboelens</dc:creator>
      <dc:date>2023-09-21T13:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying files with ModelStates via Apprentice not possible</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12257252#M158079</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1082578"&gt;@nboelens&lt;/a&gt;.&amp;nbsp; I am not super familiar with Apprentice, but on the Inventor side, there is only a ModelState 'factory' when there is more than just the original ModelState present.&amp;nbsp; And the 'factory' just seems to be whichever ModelState happens to currently be 'active' at that moment.&amp;nbsp; Because when the MemberEditScope setting is set to 'active member only' setting, you can only edit whichever ModelState that is currently active.&amp;nbsp; It is the same when working on that file by code.&amp;nbsp; The inactive ModelStates are the 'member' ones, and they can be read, but not edited, while in that edit mode.&amp;nbsp; So, in Inventor, we must first activate the ModelState that we want to edit, then edit it.&amp;nbsp; Or, we can edit the ModelStateTable either through its properties, or by using the spreadsheet option (Excel), which can also be done by code.&amp;nbsp; But I don't know about all of that from the perspective of Apprentice.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 19:07:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/modifying-files-with-modelstates-via-apprentice-not-possible/m-p/12257252#M158079</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-09-21T19:07:24Z</dc:date>
    </item>
  </channel>
</rss>

