<?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: A-side colour as materiel(flat pattern shot correctly ).  folded part is show wrong , is here a fix ? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/a-side-colour-as-materiel-flat-pattern-shot-correctly-folded/m-p/11672715#M147650</link>
    <description>Can you share the part file?</description>
    <pubDate>Wed, 11 Jan 2023 20:40:46 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2023-01-11T20:40:46Z</dc:date>
    <item>
      <title>A-side colour as materiel(flat pattern shot correctly ).  folded part is show wrong , is here a fix ?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/a-side-colour-as-materiel-flat-pattern-shot-correctly-folded/m-p/11671629#M147633</link>
      <description>&lt;P&gt;I have an ilogic code that change the colour of the A-side to the raw material colour without pattern. if an material have to be&amp;nbsp; turn the right way.&amp;nbsp; In many cases an alu floor plate with a pattern on one side. I want to change it A-side to the Alu without the pattern.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bt_0-1673444631096.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1161239i6FD9120AA59853AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bt_0-1673444631096.png" alt="bt_0-1673444631096.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The flat pattern is show&amp;nbsp; Correctly( see below) but the folded part is show wrong see. above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bt_1-1673444775171.png" style="width: 376px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1161241iDCE184C0D5E0E528/image-dimensions/376x338?v=v2" width="376" height="338" role="button" title="bt_1-1673444775171.png" alt="bt_1-1673444775171.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that a way to make it show it right on both ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May current code for this is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'this code paint the A-side same color as the material without the pattern on 
'version 1.05



If ThisDoc.Document.SubType &amp;lt;&amp;gt; "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
	'MsgBox("This is not a Sheet Metal Part. Exiting rule.", vbCritical, "")
	Exit Sub
End If


Dim CurrentSM_Style = SheetMetal.GetActiveStyle()
Dim color
If CurrentSM_Style  = "St.S235 | Tear Plate |2000x1000x3" Or CurrentSM_Style = "St.S235 | Tear Plate |2500x1250x3" Or CurrentSM_Style = "St.S235 | Floor Plate |2500x1250x5" Or CurrentSM_Style = "St.S235 | Floor Plate |3000x1500x5" Then
	Color = "Steel"
End If

If CurrentSM_Style = "Alu AW-5754 H114 | Floor Plate | 2000x1000x5" Or CurrentSM_Style = "Alu AW-5754 H114 | Floor Plate | 2500x1250x5" Or CurrentSM_Style = "Alu AW-5754 H114 | Floor Plate | 2500x1250x5*" Or CurrentSM_Style = "Alu AW-5754 H114 | Floor Plate | 3000x1500x5" Then
	Color = "Aluminium"
End If

'MsgBox(Color)

If CurrentSM_Style = "Alu AW-5754 H114 | Floor Plate | 2000x1000x5" Or CurrentSM_Style = "Alu AW-5754 H114 | Floor Plate | 2500x1250x5" Or CurrentSM_Style = "Alu AW-5754 H114 | Floor Plate | 2500x1250x5*" Or CurrentSM_Style = "Alu AW-5754 H114 | Floor Plate | 3000x1500x5" Or CurrentSM_Style = "St.S235 | Tear Plate |2000x1000x3" Or CurrentSM_Style = "St.S235 | Tear Plate |2500x1250x3" Or CurrentSM_Style = "St.S235 | Floor Plate |2500x1250x5" Or CurrentSM_Style = "St.S235 | Floor Plate |3000x1500x5" Then
	
	
Else 
	Exit Sub
	
End If


Dim oPDoc As PartDocument = ThisDoc.Document
Dim oSMDef As SheetMetalComponentDefinition = oPDoc.ComponentDefinition
Dim oFaceToChange As Face = Nothing
If oSMDef.ASideDefinitions.Count &amp;gt; 0 Then
	oFaceToChange = oSMDef.ASideDefinitions.Item(1).ASideFace
End If
If IsNothing(oFaceToChange) Then
	'try to get the 'BaseFace' from the FlatPattern
	Dim oFP As FlatPattern = Nothing
	If oSMDef.HasFlatPattern Then
		oFP = oSMDef.FlatPattern
	Else
		Try
			oSMDef.Unfold
			oFP = oSMDef.FlatPattern
			oFP.ExitEdit
		Catch
			MsgBox("Error unfolding part to get FlatPattern.", vbCritical, "")
			Exit Sub
		End Try
	End If
	If IsNothing(oFP) Then Exit Sub
	oFaceToChange = oFP.BaseFace 'usually the stationary face when others unfold
	'oFaceToChange = oFP.BottomFace
End If
'get/specify appearance type Asset to supply as value to face appearance
'Dim oInvMatLib As AssetLibrary = ThisApplication.AssetLibraries.Item("Inventor Material Library")
Dim oInvMatLib As AssetLibrary = ThisApplication.AssetLibraries.Item("KallesoeMaterialLibrary")

Dim oWhite As Asset = oInvMatLib.AppearanceAssets.Item(Color)

'Dim oWhite As Asset = oInvMatLib.AppearanceAssets.Item(Steel)
'Asset = oInvMatLib.AppearanceAssets.Item("Steel")



'get a 'local copy' of this appearance to work with (needed)
Dim oDocApps As AssetsEnumerator = oPDoc.AppearanceAssets
Dim oAppAsset As Asset = Nothing
Try
	oAppAsset = oDocApps.Item(Color)
Catch
	oAppAsset = oWhite.CopyTo(oPDoc, True)
End Try
oFaceToChange.Appearance = oAppAsset


'oFaceToChange.AppearanceSourceType = AppearanceSourceTypeEnum.kOverrideAppearance&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 13:49:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/a-side-colour-as-materiel-flat-pattern-shot-correctly-folded/m-p/11671629#M147633</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2023-01-11T13:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: A-side colour as materiel(flat pattern shot correctly ).  folded part is show wrong , is here a fix ?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/a-side-colour-as-materiel-flat-pattern-shot-correctly-folded/m-p/11672715#M147650</link>
      <description>Can you share the part file?</description>
      <pubDate>Wed, 11 Jan 2023 20:40:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/a-side-colour-as-materiel-flat-pattern-shot-correctly-folded/m-p/11672715#M147650</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2023-01-11T20:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: A-side colour as materiel(flat pattern shot correctly ).  folded part is show wrong , is here a fix ?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/a-side-colour-as-materiel-flat-pattern-shot-correctly-folded/m-p/11673650#M147657</link>
      <description>&lt;P&gt;Sure. Here you. And add the ilogic files as well&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 06:41:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/a-side-colour-as-materiel-flat-pattern-shot-correctly-folded/m-p/11673650#M147657</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2023-01-12T06:41:17Z</dc:date>
    </item>
  </channel>
</rss>

