<?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: Replacing PartsList Reference with ModelState? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343910#M17232</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;as you told, changing a views' model state will affect a linked parts list.&lt;/P&gt;&lt;P&gt;Unfortunuatelly, my customer linked the parts lists to files instead to a view.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="choppen_0-1698764754671.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286348iA8AFD29B62E1638B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="choppen_0-1698764754671.png" alt="choppen_0-1698764754671.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After selecting a file you can select the Model State:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="choppen_2-1698765209246.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286358iE126607CCB5AE0F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="choppen_2-1698765209246.png" alt="choppen_2-1698765209246.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My idea was to get the associated document (ReferencedDocument) and set the desired model state to active - which fails.&lt;/P&gt;&lt;P&gt;Probably he has to delete the tables and create them again.&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Christoph&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2023 15:26:13 GMT</pubDate>
    <dc:creator>c_hoppen</dc:creator>
    <dc:date>2023-10-31T15:26:13Z</dc:date>
    <item>
      <title>Replacing PartsList Reference with ModelState?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343700#M17230</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need to replace a PartsList reference &lt;STRONG&gt;with a specific ModelState&lt;/STRONG&gt;. Ih could use&amp;nbsp;FileDescriptor.ReplaceReference but this only allows me to give a new file name. So I tried this:&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;LI-CODE lang="general"&gt;	Dim partslist As PartsList = doc.SelectSet.Item(1)
	Dim refDoc As AssemblyDocument = partslist.ReferencedDocumentDescriptor.ReferencedDocument
	Dim mss As ModelStates = refDoc.ComponentDefinition.ModelStates
	Dim ms As ModelState = mss.Item("xxx")
	ms.Activate ' throws an exception
	&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Assumes&amp;nbsp; that xxx exists. The active ModelState is primary).&lt;/P&gt;&lt;P&gt;Any chance to do this?&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Christoph&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 14:23:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343700#M17230</guid>
      <dc:creator>c_hoppen</dc:creator>
      <dc:date>2023-10-31T14:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing PartsList Reference with ModelState?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343814#M17231</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1701763"&gt;@c_hoppen&lt;/a&gt;.&amp;nbsp; When you created / placed the PartsList initially, did you choose a drawing view to associate it with, or did you choose a file from the file browser directly?&amp;nbsp; If you choose a view, you could try changing the ModelState that the source view is referencing, and see if that also effects the PartsList that is based on that view.&amp;nbsp; But I am not sure if that connection is maintained after the creation of the PartsList, because there does not seem to be any exposed method or property of the PartsList for getting or setting a DrawingView directly.&amp;nbsp; If that does not work, then you may just need to delete then create a new PartsList to replace it.&amp;nbsp; In a quick test of a new drawing with a single sheet, and single view in it of an assembly with multiple ModelStates, and a PartsList based on that view...if I manually change which ModelState that view is set to, it shows a small interactive dialog letting me know about the change, and asking me if would like to update all PartsLists in this document to use one or the other ModelState instead.&amp;nbsp; That could be seen as a connection between the view and the PartsList, but that one view in that situation was the only reference to the model document, so it's difficult to judge.&amp;nbsp; Not sure how we could avoid, or react to that question if attempting to change the ModelState of the view by code though.&amp;nbsp; It may simply not be shown, and use a default response, or it may throw an error, because we need to answer the question that there is no way to do by code.&amp;nbsp; Not sure.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_0-1698764156947.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286344iF70B222473F6978B/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_0-1698764156947.png" alt="WCrihfield_0-1698764156947.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; Here is the link to the blue link shown at the bottom of that dialog image above, just for reference:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-7070AD70-276B-42C7-A163-46B38B9C2465" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-7070AD70-276B-42C7-A163-46B38B9C2465&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 15:03:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343814#M17231</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-10-31T15:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing PartsList Reference with ModelState?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343910#M17232</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;as you told, changing a views' model state will affect a linked parts list.&lt;/P&gt;&lt;P&gt;Unfortunuatelly, my customer linked the parts lists to files instead to a view.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="choppen_0-1698764754671.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286348iA8AFD29B62E1638B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="choppen_0-1698764754671.png" alt="choppen_0-1698764754671.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After selecting a file you can select the Model State:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="choppen_2-1698765209246.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286358iE126607CCB5AE0F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="choppen_2-1698765209246.png" alt="choppen_2-1698765209246.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My idea was to get the associated document (ReferencedDocument) and set the desired model state to active - which fails.&lt;/P&gt;&lt;P&gt;Probably he has to delete the tables and create them again.&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Christoph&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 15:26:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343910#M17232</guid>
      <dc:creator>c_hoppen</dc:creator>
      <dc:date>2023-10-31T15:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing PartsList Reference with ModelState?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343957#M17233</link>
      <description>&lt;P&gt;That would be my guess too.&amp;nbsp; The &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=PartsList_ReferencedDocumentDescriptor" target="_blank" rel="noopener"&gt;PartsList.ReferencedDocumentDescriptor&lt;/A&gt;&amp;nbsp; property returns a &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-DocumentDescriptor" target="_blank" rel="noopener"&gt;DocumentDescriptor&lt;/A&gt;&amp;nbsp;object, then that DocumentDescriptor object has a property named &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DocumentDescriptor_ReferencedModelState" target="_blank" rel="noopener"&gt;ReferencedModelState&lt;/A&gt;, but that is a ReadOnly property with a value being a variation of the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ModelStateTypeEnum" target="_blank" rel="noopener"&gt;ModelStateTypeEnum&lt;/A&gt;, so no luck there.&amp;nbsp; It would be nice if they were able to make that property (or another similar one) Read/Write, with a String type value (name of the ModelState).&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; The DocumentDescriptor's &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DocumentDescriptor_FullDocumentName" target="_blank" rel="noopener"&gt;FullDocumentName&lt;/A&gt; property would have been another opportunity to change which ModelState it is pointing to, but nope, that had to be ReadOnly also.&amp;nbsp; The FullDocumentName would normally contain the name of the ModelState after its FullFileName portion, within "&amp;lt;" &amp;amp; "&amp;gt;" brackets.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 15:41:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12343957#M17233</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-10-31T15:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing PartsList Reference with ModelState?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12344804#M17234</link>
      <description>&lt;P&gt;The link is maintained.&lt;/P&gt;&lt;P&gt;I save as drawing and change ModelState in view to make drawings for each ModelState.&lt;/P&gt;&lt;P&gt;I also use this command:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReplaceRef-01.jpg" style="width: 419px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286536i594DD3814ABC6C90/image-size/large?v=v2&amp;amp;px=999" role="button" title="ReplaceRef-01.jpg" alt="ReplaceRef-01.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Work with or without ModelState.&lt;/P&gt;&lt;P&gt;Maybe look for referenced documents in Drawing Doc.&lt;/P&gt;&lt;P&gt;Don't know if it can be found in Sheet and View.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 21:31:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12344804#M17234</guid>
      <dc:creator>Frederick_Law</dc:creator>
      <dc:date>2023-10-31T21:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing PartsList Reference with ModelState?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12348769#M17235</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5289378"&gt;@Frederick_Law&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;&lt;P&gt;The link is maintained.&lt;/P&gt;&lt;P&gt;I save as drawing and change ModelState in view to make drawings for each ModelState.&lt;/P&gt;&lt;P&gt;I also use this command:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ReplaceRef-01.jpg" style="width: 419px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1286536i594DD3814ABC6C90/image-size/large?v=v2&amp;amp;px=999" role="button" title="ReplaceRef-01.jpg" alt="ReplaceRef-01.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Work with or without ModelState.&lt;/P&gt;&lt;P&gt;Maybe look for referenced documents in Drawing Doc.&lt;/P&gt;&lt;P&gt;Don't know if it can be found in Sheet and View.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I can replace references by filename, but not filename + Model State. That's what I asked.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 10:12:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12348769#M17235</guid>
      <dc:creator>c_hoppen</dc:creator>
      <dc:date>2023-11-02T10:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing PartsList Reference with ModelState?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12349337#M17236</link>
      <description>&lt;P&gt;Yes, you can.&lt;/P&gt;&lt;P&gt;Select the file with ModelState and Click Option:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Model State-03.jpg" style="width: 475px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1287551iD2E5694741B3E78B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Model State-03.jpg" alt="Model State-03.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I think that's may not the problem you have.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 13:57:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12349337#M17236</guid>
      <dc:creator>Frederick_Law</dc:creator>
      <dc:date>2023-11-02T13:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing PartsList Reference with ModelState?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12349370#M17237</link>
      <description>Yes - you can select filename and model state, but only by UI! I want do it by API.&lt;BR /&gt;I know FileDescriptor.ReplaceReference, but this method only takes the FullFileName.</description>
      <pubDate>Thu, 02 Nov 2023 14:06:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replacing-partslist-reference-with-modelstate/m-p/12349370#M17237</guid>
      <dc:creator>c_hoppen</dc:creator>
      <dc:date>2023-11-02T14:06:39Z</dc:date>
    </item>
  </channel>
</rss>

