<?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 Control Sheet Metal Styles from linked parameter in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/control-sheet-metal-styles-from-linked-parameter/m-p/11850254#M25587</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying be efficient and make use of iLogic to control Sheet Metal Styles in the model for multiple parts. I have a skeleton file with multi value parameters inside. I want this to control the sheet metal style in multiple parts linked to this skeleton file.&amp;nbsp; I have this code so far but no joy when the skeleton file is modified. I have checked the naming of parameters and sheet metail styles and this is correct. At the moment there are approximately 20 unique parts that would be setup to be controlled in this fashion. My intension was to setup a form that can be controlled from the assembly to alter multiple parameters for the model. If there is a better wahy to achieve this I am open to suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;BottomThk&lt;/SPAN&gt; = &lt;SPAN&gt;"6 mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"MS S275_6"&lt;/SPAN&gt;)

&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;BottomThk&lt;/SPAN&gt; = &lt;SPAN&gt;"8 mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"MS S275_8"&lt;/SPAN&gt;)	

&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;BottomThk&lt;/SPAN&gt; = &lt;SPAN&gt;"10 mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"MS S275_10"&lt;/SPAN&gt;)

&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;BottomThk&lt;/SPAN&gt; = &lt;SPAN&gt;"12 mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"MS S275_12"&lt;/SPAN&gt;)

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Thanks in advance, Nigel&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2023 11:48:25 GMT</pubDate>
    <dc:creator>Nigel.Sims</dc:creator>
    <dc:date>2023-03-27T11:48:25Z</dc:date>
    <item>
      <title>Control Sheet Metal Styles from linked parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/control-sheet-metal-styles-from-linked-parameter/m-p/11850254#M25587</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying be efficient and make use of iLogic to control Sheet Metal Styles in the model for multiple parts. I have a skeleton file with multi value parameters inside. I want this to control the sheet metal style in multiple parts linked to this skeleton file.&amp;nbsp; I have this code so far but no joy when the skeleton file is modified. I have checked the naming of parameters and sheet metail styles and this is correct. At the moment there are approximately 20 unique parts that would be setup to be controlled in this fashion. My intension was to setup a form that can be controlled from the assembly to alter multiple parameters for the model. If there is a better wahy to achieve this I am open to suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;BottomThk&lt;/SPAN&gt; = &lt;SPAN&gt;"6 mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"MS S275_6"&lt;/SPAN&gt;)

&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;BottomThk&lt;/SPAN&gt; = &lt;SPAN&gt;"8 mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"MS S275_8"&lt;/SPAN&gt;)	

&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;BottomThk&lt;/SPAN&gt; = &lt;SPAN&gt;"10 mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"MS S275_10"&lt;/SPAN&gt;)

&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;BottomThk&lt;/SPAN&gt; = &lt;SPAN&gt;"12 mm"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"MS S275_12"&lt;/SPAN&gt;)

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Thanks in advance, Nigel&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 11:48:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/control-sheet-metal-styles-from-linked-parameter/m-p/11850254#M25587</guid>
      <dc:creator>Nigel.Sims</dc:creator>
      <dc:date>2023-03-27T11:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Control Sheet Metal Styles from linked parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/control-sheet-metal-styles-from-linked-parameter/m-p/11853709#M25588</link>
      <description>&lt;P&gt;So the ilogic snippet will only ever effect the file it is run in. If you need to effect files higher up you will need to find something that ties your driver to the driven. If its the case that the skelton is a reference file then that would be perfect. This is the harder piece and will need your response before posting a sample of that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The easier is to&amp;nbsp;to use API methods to access the &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=SheetMetalComponentDefinition_ActiveSheetMetalStyle" target="_blank" rel="noopener"&gt;active sheet metal style&lt;/A&gt;. This is done from the component definition of the document.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SheetMetalComponentDefinition.&lt;/SPAN&gt;&lt;STRONG&gt;ActiveSheetMetalStyle&lt;/STRONG&gt;&lt;SPAN&gt;() As&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=SheetMetalStyle" target="_blank" rel="noopener"&gt;SheetMetalStyle&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://modthemachine.typepad.com/my_weblog/2009/03/accessing-assembly-components.html" target="_blank" rel="noopener"&gt;Reference article for accessing assembly components.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    ' Get the active assembly.
    Dim oAsmDoc As AssemblyDocument = ThisDoc.Document
    ' Get all of the referenced documents.
    Dim oRefDocs As DocumentsEnumerator = oAsmDoc.AllReferencedDocuments

    ' Iterate through the list of documents.
    Dim oRefDoc As Document
    For Each oRefDoc In oRefDocs

      Logger.Info(oRefDoc.DisplayName)
      
      Dim oRefDef As ComponentDefinition = oRefDoc.ComponentDefinition
      
      If oRefDef.Type = ObjectTypeEnum.kSheetMetalComponentDefinitionObject Then
         oRefDef.ActiveSheetMetalStyle = "Enter Style Name Here"
       End If
    Next&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 14:40:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/control-sheet-metal-styles-from-linked-parameter/m-p/11853709#M25588</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2023-03-28T14:40:11Z</dc:date>
    </item>
  </channel>
</rss>

