<?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: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11103606#M136713</link>
    <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12232081"&gt;@antonio.silvaluna&lt;/a&gt;.&amp;nbsp; Here is another version you can try that is similar to the last one I posted.&amp;nbsp; But this version does not use the StandardObjectFactory route.&amp;nbsp; Instead it uses the API route.&amp;nbsp; I also combined the two Sub routines into one.&amp;nbsp; That Sub routine might even be simplified even further since the 'test' version of SheetMetalStyle is always named exactly the same as the original, but with the " (Test)" at the end if its name.&amp;nbsp; It might just be able to capture its current SheetMetalStyle name, check if it 'EndsWith' " (Test)", and if not, try to change it to the same name with that at the end of it.&amp;nbsp; But I don't know if that would fit your more practical needs later.&amp;nbsp; But since the other 'Test' version SheetMetalStyle might not exist, in order to avoid that potential error without making the code exponentially longer, I incorporated a Try...Catch statement, and put the main task inside of that.&amp;nbsp; And since I don't know how many components you may be cycling through, in the Catch side I left the MsgBox commented out, and left the Logger line un-commented, to help it run more smoothly.&amp;nbsp; You would then want to check your iLogicLog tab to see if it encountered any problems afterwards.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main()
	If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then
		MsgBox("An Assembly Document must be active for this rule to work. Exiting.", vbCritical, "")
		Exit Sub
	End If
	Dim oADoc As AssemblyDocument = ThisDoc.Document
	ChangeToTest(oADoc)
End Sub

Sub ChangeToTest(oADoc As AssemblyDocument)
	For Each oOcc As ComponentOccurrence In oADoc.ComponentDefinition.Occurrences
		If oOcc.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
			ChangeToTest(oOcc.Definition.Document)
		End If
		If Not TypeOf oOcc.Definition Is SheetMetalComponentDefinition Then Continue For
		Dim oSMDef As SheetMetalComponentDefinition = oOcc.Definition
		Dim ActiveStyle As SheetMetalStyle = oSMDef.ActiveSheetMetalStyle
		'since the other named SheetMetalStyle may not exist, we will use a Try...Catch statement
		Try
			If ActiveStyle.Name = "10ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("10ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "10ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("10ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "10ga SS 304L Solid" Then
				oSMDef.SheetMetalStyles.Item("10ga SS 304L Solid (Test)").Activate
			ElseIf ActiveStyle.Name = "12ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("12ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "12ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("12ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "14ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("14ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "14ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("14ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "14ga SS 304L Solid" Then
				oSMDef.SheetMetalStyles.Item("14ga SS 304L Solid (Test)").Activate
			ElseIf ActiveStyle.Name = "16ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("16ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "16ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("16ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "16ga SS 304L Solid" Then
				oSMDef.SheetMetalStyles.Item("16ga SS 304L Solid (Test)").Activate
			ElseIf ActiveStyle.Name = "18ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("18ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "18ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("18ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "18ga SS 304L Solid" Then
				oSMDef.SheetMetalStyles.Item("18ga SS 304L Solid (Test)").Activate	
			ElseIf ActiveStyle.Name = "20ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("20ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "20ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("20ga GA Jkt (Test)").Activate
			Else
				oSMDef.SheetMetalStyles.Item("Default").Activate
				Dim oSMDoc As PartDocument = oSMDef.Document
				oSMDoc.PropertySets.Item("Design Tracking Properties").Item("Stock Number").Value = "Material no disponible para tolerancias"
				oSMDoc.PropertySets.Item("Design Tracking Properties").Item("Description").Value = "Material no disponible para tolerancias"
			End If
		Catch oEx As Exception
			'MsgBox(oEx.Message &amp;amp; vbCrLf &amp;amp; oEx.StackTrace, vbExclamation, "")
			Logger.Error(oEx.Message &amp;amp; vbCrLf &amp;amp; oEx.StackTrace)
		End Try
	Next
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 13:39:07 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2022-04-13T13:39:07Z</dc:date>
    <item>
      <title>Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024200#M135831</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;has anyone changed sheet metal styles from the assembly?&lt;/P&gt;&lt;P&gt;I'm trying to run the ChangeStyleToNewOne rule on each of the sheetmetal parts in an assembly, but it's not working.&lt;/P&gt;&lt;P&gt;Does anyone have any ideas how I can fix it?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;()

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;thisAssyDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;CType&lt;/SPAN&gt;(&lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;, &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;)

&lt;SPAN&gt;AddCusProp&lt;/SPAN&gt;(&lt;SPAN&gt;thisAssyDoc&lt;/SPAN&gt;)
 
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;AddCusProp&lt;/SPAN&gt;(&lt;SPAN&gt;assemblyDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;)&lt;BR /&gt;
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;subCompOcc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;assemblyDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;
		
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;= &lt;SPAN&gt;subCompOcc&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveEditDocument&lt;/SPAN&gt;

		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt;.&lt;SPAN&gt;SubType&lt;/SPAN&gt; = &lt;SPAN&gt;"{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oscCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalStyle&lt;/SPAN&gt; = &lt;SPAN&gt;oscCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveSheetMetalStyle&lt;/SPAN&gt;
			&lt;SPAN&gt;ChangeStyleToNewOne&lt;/SPAN&gt;(&lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt;)
		
		&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt;.&lt;SPAN&gt;SubType&lt;/SPAN&gt; = &lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			
			&lt;SPAN&gt;AddCusProp&lt;/SPAN&gt;(&lt;SPAN&gt;oPartDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Definition&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;)
			
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

	&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;ChangeStyleToNewOne&lt;/SPAN&gt;(&lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt;)
	
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"10ga GA Brt"&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;"10ga GA Brt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"10ga GA Jkt"&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;"10ga GA Jkt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"10ga SS 304L Solid"&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;"10ga SS 304L Solid (Test)"&lt;/SPAN&gt;)	
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"12ga GA Brt"&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;"12ga GA Brt (Test)"&lt;/SPAN&gt;)

	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"12ga GA Jkt"&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;"12ga GA Jkt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"14ga GA Brt"&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;"14ga GA Brt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"14ga GA Jkt"&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;"14ga GA Jkt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"14ga SS 304L Solid"&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;"14ga SS 304L Solid (Test)"&lt;/SPAN&gt;)	
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"16ga GA Brt"&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;"16ga GA Brt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"16ga GA Jkt"&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;"16ga GA Jkt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"16ga SS 304L Solid"&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;"16ga SS 304L Solid (Test)"&lt;/SPAN&gt;)	
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"18ga GA Brt"&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;"18ga GA Brt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"18ga GA Jkt"&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;"18ga GA Jkt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"18ga SS 304L Solid"&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;"18ga SS 304L Solid (Test)"&lt;/SPAN&gt;)	
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"20ga GA Brt"&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;"20ga GA Brt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;ActiveStyle&lt;/SPAN&gt; = &lt;SPAN&gt;"20ga GA Jkt"&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;"20ga GA Jkt (Test)"&lt;/SPAN&gt;)
		
	&lt;SPAN&gt;Else&lt;/SPAN&gt;
		&lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;SetActiveStyle&lt;/SPAN&gt;(&lt;SPAN&gt;"Default"&lt;/SPAN&gt;)
		&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Stock Number"&lt;/SPAN&gt;) = &lt;SPAN&gt;"Material no disponible para tolerancias"&lt;/SPAN&gt;
		&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Project"&lt;/SPAN&gt;, &lt;SPAN&gt;"Description"&lt;/SPAN&gt;) = &lt;SPAN&gt;"Material no disponible para tolerancias"&lt;/SPAN&gt;	
		
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;	
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:45:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024200#M135831</guid>
      <dc:creator>antonio.silvaluna</dc:creator>
      <dc:date>2022-03-23T15:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024267#M135834</link>
      <description>&lt;P&gt;This worked&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;SheetMetalStyles&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"18GA GA Jkt (Test)"&lt;/SPAN&gt;).&lt;SPAN&gt;Activate&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Mar 2022 16:08:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024267#M135834</guid>
      <dc:creator>dalton98</dc:creator>
      <dc:date>2022-03-23T16:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024308#M135837</link>
      <description>&lt;P&gt;What version of Inventor are you using?&amp;nbsp; Try this version of your code.&amp;nbsp; I changed a few thing around, and I am using a fairly new tool to direct all those vague iLogic snippets to the proper document reference.&amp;nbsp; If you have any questions about any of this, feel free to ask them.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main()
	Dim thisAssyDoc As AssemblyDocument = CType(ThisDoc.Document, AssemblyDocument)
	AddCusProp(thisAssyDoc)
End Sub

Sub AddCusProp(assemblyDoc As AssemblyDocument)
	For Each subCompOcc As ComponentOccurrence In assemblyDoc.ComponentDefinition.Occurrences
		If subCompOcc.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
			AddCusProp(subCompOcc.Definition.Document)
		End If
		If Not TypeOf subCompOcc.Definition Is SheetMetalComponentDefinition Then Continue For
		Dim oscCompDef As SheetMetalComponentDefinition = subCompOcc.Definition
		Dim ActiveStyle As SheetMetalStyle = oscCompDef.ActiveSheetMetalStyle
		ChangeStyleToNewOne(oscCompDef.Document, ActiveStyle)
	Next
End Sub

Sub ChangeStyleToNewOne(oSMDoc As PartDocument, ActiveStyle As SheetMetalStyle)
	Dim SOP = StandardObjectFactory.Create(oSMDoc)
	If ActiveStyle.Name = "10ga GA Brt" Then
		SOP.SheetMetal.SetActiveStyle("10ga GA Brt (Test)")
	ElseIf ActiveStyle.Name = "10ga GA Jkt" Then
		SOP.SheetMetal.SetActiveStyle("10ga GA Jkt (Test)")
	ElseIf ActiveStyle.Name = "10ga SS 304L Solid" Then
		SOP.SheetMetal.SetActiveStyle("10ga SS 304L Solid (Test)")
	ElseIf ActiveStyle.Name = "12ga GA Brt" Then
		SOP.SheetMetal.SetActiveStyle("12ga GA Brt (Test)")
	ElseIf ActiveStyle.Name = "12ga GA Jkt" Then
		SOP.SheetMetal.SetActiveStyle("12ga GA Jkt (Test)")
	ElseIf ActiveStyle.Name = "14ga GA Brt" Then
		SOP.SheetMetal.SetActiveStyle("14ga GA Brt (Test)")
	ElseIf ActiveStyle.Name = "14ga GA Jkt" Then
		SOP.SheetMetal.SetActiveStyle("14ga GA Jkt (Test)")
	ElseIf ActiveStyle.Name = "14ga SS 304L Solid" Then
		SOP.SheetMetal.SetActiveStyle("14ga SS 304L Solid (Test)")
	ElseIf ActiveStyle.Name = "16ga GA Brt" Then
		SOP.SheetMetal.SetActiveStyle("16ga GA Brt (Test)")
	ElseIf ActiveStyle.Name = "16ga GA Jkt" Then
		SOP.SheetMetal.SetActiveStyle("16ga GA Jkt (Test)")
	ElseIf ActiveStyle.Name = "16ga SS 304L Solid" Then
		SOP.SheetMetal.SetActiveStyle("16ga SS 304L Solid (Test)")
	ElseIf ActiveStyle.Name = "18ga GA Brt" Then
		SOP.SheetMetal.SetActiveStyle("18ga GA Brt (Test)")
	ElseIf ActiveStyle.Name = "18ga GA Jkt" Then
		SOP.SheetMetal.SetActiveStyle("18ga GA Jkt (Test)")
	ElseIf ActiveStyle.Name = "18ga SS 304L Solid" Then
		SOP.SheetMetal.SetActiveStyle("18ga SS 304L Solid (Test)")	
	ElseIf ActiveStyle.Name = "20ga GA Brt" Then
		SOP.SheetMetal.SetActiveStyle("20ga GA Brt (Test)")
	ElseIf ActiveStyle.Name = "20ga GA Jkt" Then
		SOP.SheetMetal.SetActiveStyle("20ga GA Jkt (Test)")
	Else
		SOP.SheetMetal.SetActiveStyle("Default")
		SOP.iProperties.Value("Project", "Stock Number") = "Material no disponible para tolerancias"
		SOP.iProperties.Value("Project", "Description") = "Material no disponible para tolerancias"	
	End If	
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;.&lt;/P&gt;
&lt;P&gt;If you want and have time, I would appreciate your Vote(s) for &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;/A&gt; :bulb: or you can Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 16:26:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024308#M135837</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-03-23T16:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024424#M135843</link>
      <description>I have inventor 2020&lt;BR /&gt;This code show this error&lt;BR /&gt;Error on Line 19 : 'StandardObjectFactory' is not declared. It may be inaccessible due to its protection level.</description>
      <pubDate>Wed, 23 Mar 2022 17:13:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024424#M135843</guid>
      <dc:creator>antonio.silvaluna</dc:creator>
      <dc:date>2022-03-23T17:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024426#M135844</link>
      <description>Let me try thanks</description>
      <pubDate>Wed, 23 Mar 2022 17:14:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024426#M135844</guid>
      <dc:creator>antonio.silvaluna</dc:creator>
      <dc:date>2022-03-23T17:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024529#M135846</link>
      <description>&lt;P&gt;OK.&amp;nbsp; I think that StandardObjectFactory.Create() tool just became available in Inventor 2022, so that will not be an option to use in this situation.&amp;nbsp; The idea of using it though, was because that "SheetMetal" iLogic snippet does not have a way for you to specify which document you want it to act upon (target), and this would have been one way of making it target a specific document. &amp;nbsp;&amp;nbsp; The "iProperties.Value()" iLogic snippet does allow you to specify either a component name or document name, as the first (of 3) input variables, but that can be confusing to use too, when you are wanting it to target another document.&amp;nbsp; In situations like this, I usually prefer to eliminate the use of that iProperties.Value snippet, in favor of the regular Inventor API route:&lt;/P&gt;
&lt;P&gt;Document.PropertySets.Item("PropertySetName").Item("PropertyName").Value&lt;/P&gt;
&lt;P&gt;That way you can start from an actual Document object, so you know for sure which document you are dealing with.&amp;nbsp; The SheetMetal snippet can also be avoided, in favor of similar (but longer) API route if needed, similar to the code that &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11795854"&gt;@dalton98&lt;/a&gt; posted.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 17:59:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11024529#M135846</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-03-23T17:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11102233#M136675</link>
      <description>I'm trying to use this code but I don't know how I can add the For Each loop, Could you help with more information about this</description>
      <pubDate>Tue, 12 Apr 2022 23:30:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11102233#M136675</guid>
      <dc:creator>antonio.silvaluna</dc:creator>
      <dc:date>2022-04-12T23:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11102242#M136676</link>
      <description>I try this&lt;BR /&gt;Sub Main()&lt;BR /&gt;Dim thisAssyDoc As AssemblyDocument = CType(ThisDoc.Document, AssemblyDocument)&lt;BR /&gt;ChangeToTest(thisAssyDoc)&lt;BR /&gt;End Sub&lt;BR /&gt;&lt;BR /&gt;Sub ChangeToTest(assemblyDoc As AssemblyDocument)&lt;BR /&gt;&lt;BR /&gt;For Each subCompOcc As ComponentOccurrence In assemblyDoc.ComponentDefinition.Occurrences&lt;BR /&gt;&lt;BR /&gt;Dim oDoc As PartDocument&lt;BR /&gt;oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;Dim oCompDef As SheetMetalComponentDefinition&lt;BR /&gt;&lt;BR /&gt;If oCompDef is oDoc.ComponentDefinition Then&lt;BR /&gt;&lt;BR /&gt;oCompDef.SheetMetalStyles.Item("18ga GA JKT (Test)").Activate&lt;BR /&gt;Else&lt;BR /&gt;MessageBox.Show("Fail", "Title")&lt;BR /&gt;&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Apr 2022 23:43:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11102242#M136676</guid>
      <dc:creator>antonio.silvaluna</dc:creator>
      <dc:date>2022-04-12T23:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11102380#M136678</link>
      <description>&lt;P&gt;Here is a working code to change the style of level one occurrences in an assembly. If the sheetmetal parts are in a subassembly you will need additional code to detect an assembly and iterate through those as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;()
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;thisAssyDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;CType&lt;/SPAN&gt;(&lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;, &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;)
&lt;SPAN&gt;ChangeToTest&lt;/SPAN&gt;(&lt;SPAN&gt;thisAssyDoc&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;ChangeToTest&lt;/SPAN&gt;(&lt;SPAN&gt;assemblyDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;)

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;subCompOcc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;assemblyDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;subCompOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Definition&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;oCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;subCompOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Definition&lt;/SPAN&gt;
		&lt;SPAN&gt;Try&lt;/SPAN&gt;
		&lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;SheetMetalStyles&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"18ga GA JKT (Test)"&lt;/SPAN&gt;).&lt;SPAN&gt;Activate&lt;/SPAN&gt;
		&lt;SPAN&gt;Catch&lt;/SPAN&gt;
			&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Fail to find Style"&lt;/SPAN&gt;, &lt;SPAN&gt;"Title"&lt;/SPAN&gt;)
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;Else&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Fail"&lt;/SPAN&gt;, &lt;SPAN&gt;"Title"&lt;/SPAN&gt;)
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 01:49:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11102380#M136678</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2022-04-13T01:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11103606#M136713</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12232081"&gt;@antonio.silvaluna&lt;/a&gt;.&amp;nbsp; Here is another version you can try that is similar to the last one I posted.&amp;nbsp; But this version does not use the StandardObjectFactory route.&amp;nbsp; Instead it uses the API route.&amp;nbsp; I also combined the two Sub routines into one.&amp;nbsp; That Sub routine might even be simplified even further since the 'test' version of SheetMetalStyle is always named exactly the same as the original, but with the " (Test)" at the end if its name.&amp;nbsp; It might just be able to capture its current SheetMetalStyle name, check if it 'EndsWith' " (Test)", and if not, try to change it to the same name with that at the end of it.&amp;nbsp; But I don't know if that would fit your more practical needs later.&amp;nbsp; But since the other 'Test' version SheetMetalStyle might not exist, in order to avoid that potential error without making the code exponentially longer, I incorporated a Try...Catch statement, and put the main task inside of that.&amp;nbsp; And since I don't know how many components you may be cycling through, in the Catch side I left the MsgBox commented out, and left the Logger line un-commented, to help it run more smoothly.&amp;nbsp; You would then want to check your iLogicLog tab to see if it encountered any problems afterwards.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main()
	If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then
		MsgBox("An Assembly Document must be active for this rule to work. Exiting.", vbCritical, "")
		Exit Sub
	End If
	Dim oADoc As AssemblyDocument = ThisDoc.Document
	ChangeToTest(oADoc)
End Sub

Sub ChangeToTest(oADoc As AssemblyDocument)
	For Each oOcc As ComponentOccurrence In oADoc.ComponentDefinition.Occurrences
		If oOcc.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
			ChangeToTest(oOcc.Definition.Document)
		End If
		If Not TypeOf oOcc.Definition Is SheetMetalComponentDefinition Then Continue For
		Dim oSMDef As SheetMetalComponentDefinition = oOcc.Definition
		Dim ActiveStyle As SheetMetalStyle = oSMDef.ActiveSheetMetalStyle
		'since the other named SheetMetalStyle may not exist, we will use a Try...Catch statement
		Try
			If ActiveStyle.Name = "10ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("10ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "10ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("10ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "10ga SS 304L Solid" Then
				oSMDef.SheetMetalStyles.Item("10ga SS 304L Solid (Test)").Activate
			ElseIf ActiveStyle.Name = "12ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("12ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "12ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("12ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "14ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("14ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "14ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("14ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "14ga SS 304L Solid" Then
				oSMDef.SheetMetalStyles.Item("14ga SS 304L Solid (Test)").Activate
			ElseIf ActiveStyle.Name = "16ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("16ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "16ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("16ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "16ga SS 304L Solid" Then
				oSMDef.SheetMetalStyles.Item("16ga SS 304L Solid (Test)").Activate
			ElseIf ActiveStyle.Name = "18ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("18ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "18ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("18ga GA Jkt (Test)").Activate
			ElseIf ActiveStyle.Name = "18ga SS 304L Solid" Then
				oSMDef.SheetMetalStyles.Item("18ga SS 304L Solid (Test)").Activate	
			ElseIf ActiveStyle.Name = "20ga GA Brt" Then
				oSMDef.SheetMetalStyles.Item("20ga GA Brt (Test)").Activate
			ElseIf ActiveStyle.Name = "20ga GA Jkt" Then
				oSMDef.SheetMetalStyles.Item("20ga GA Jkt (Test)").Activate
			Else
				oSMDef.SheetMetalStyles.Item("Default").Activate
				Dim oSMDoc As PartDocument = oSMDef.Document
				oSMDoc.PropertySets.Item("Design Tracking Properties").Item("Stock Number").Value = "Material no disponible para tolerancias"
				oSMDoc.PropertySets.Item("Design Tracking Properties").Item("Description").Value = "Material no disponible para tolerancias"
			End If
		Catch oEx As Exception
			'MsgBox(oEx.Message &amp;amp; vbCrLf &amp;amp; oEx.StackTrace, vbExclamation, "")
			Logger.Error(oEx.Message &amp;amp; vbCrLf &amp;amp; oEx.StackTrace)
		End Try
	Next
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 13:39:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11103606#M136713</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-04-13T13:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get, validate and set a new sheet metal style from the assembly in all the SheetMetal components</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11104154#M136736</link>
      <description>Thanks everything it's working well</description>
      <pubDate>Wed, 13 Apr 2022 17:47:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/get-validate-and-set-a-new-sheet-metal-style-from-the-assembly/m-p/11104154#M136736</guid>
      <dc:creator>antonio.silvaluna</dc:creator>
      <dc:date>2022-04-13T17:47:54Z</dc:date>
    </item>
  </channel>
</rss>

