<?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: Clear Overide on all Conponent(first level ) on assambly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clear-overide-on-all-conponent-first-level-on-assambly/m-p/9086750#M102153</link>
    <description>&lt;P&gt;It almost work I did have to delete 2 line of the code... but after that it look like it will work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oAsmCompDef 'As AssemblyComponentDefinition

 
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
 
 Dim oViewReps As DesignViewRepresentations
oViewReps = oAsmCompDef.RepresentationsManager.DesignViewRepresentations


'define view rep
Dim oViewRep As DesignViewRepresentation


Dim NumberOfView = oViewReps.Count
' get Manager of Representations

 Dim dViewRepMgr As RepresentationsManager
 dViewRepMgr = oAsmCompDef.RepresentationsManager

 'Get active Representation View
 Dim dViewRep As DesignViewRepresentation
 dViewRep = dViewRepMgr.ActiveDesignViewRepresentation

 
 

For i = 1 To NumberOfView
 If iProperties.Value("Custom", "Surface") = "Raw" Or iProperties.Value("Custom", "Surface") = "Galv." Or iProperties.Value("Custom", "Surface") = "Colour 1" Or iProperties.Value("Custom", "Surface") = "Colour 2" Or iProperties.Value("Custom", "Surface") = "RAL 5003" Or iProperties.Value("Custom", "Surface") = "RAL 9010" Or iProperties.Value("Custom", "Surface") = "RAL 1028" Or iProperties.Value("Custom", "Surface") = "RAL 9005"  Or iProperties.Value("Custom", "Surface") = "EG-Galv" Or iProperties.Value("Custom", "Surface") = "HDG-Galv"  Then

oViewReps.Item(i).Activate
End If

'---------------------
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisDoc.Document
&lt;STRIKE&gt;Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAsmDoc.ComponentDefinition&lt;/STRIKE&gt;

&lt;FONT color="#FF0000"&gt;Dim objColl As ObjectCollection 
objColl = ThisApplication.TransientObjects.CreateObjectCollection&lt;/FONT&gt; 

Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences

	&lt;FONT color="#FF0000"&gt;Call objColl.Add(oOccurrence)&lt;/FONT&gt;

 
 iLogicVb.UpdateWhenDone = True

Next
&lt;FONT color="#FF0000"&gt;oAsmCompDef.ClearAppearanceOverrides(objColl)&lt;/FONT&gt;
'-------------------------
iLogicVb.UpdateWhenDone = True

Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Oct 2019 08:02:15 GMT</pubDate>
    <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
    <dc:date>2019-10-15T08:02:15Z</dc:date>
    <item>
      <title>Clear Overide on all Conponent(first level ) on assambly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clear-overide-on-all-conponent-first-level-on-assambly/m-p/9085682#M102138</link>
      <description>&lt;P&gt;I have this code .. I keep getting an error .. that I want the code to&lt;/P&gt;&lt;P&gt;do is to cleal override the component in the assembly on all view... I have a code that do the same for part... that work ... I have a code the can add an colour to the component or part ... but I like to make the code needed to remove the colour again after add them to the part and assembly ... only thing that I can not get to work jet is the assembly&amp;nbsp; clearsoverride.. see the code I have so far below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Dim oAsmCompDef 'As AssemblyComponentDefinition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Dim oViewReps As DesignViewRepresentations&lt;BR /&gt;oViewReps = oAsmCompDef.RepresentationsManager.DesignViewRepresentations&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'define view rep&lt;BR /&gt;Dim oViewRep As DesignViewRepresentation&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dim NumberOfView = oViewReps.Count&lt;BR /&gt;' get Manager of Representations&lt;/P&gt;&lt;P&gt;&amp;nbsp;Dim dViewRepMgr As RepresentationsManager&lt;BR /&gt;&amp;nbsp;dViewRepMgr = oAsmCompDef.RepresentationsManager&lt;/P&gt;&lt;P&gt;&amp;nbsp;'Get active Representation View&lt;BR /&gt;&amp;nbsp;Dim dViewRep As DesignViewRepresentation&lt;BR /&gt;&amp;nbsp;dViewRep = dViewRepMgr.ActiveDesignViewRepresentation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For i = 1 To NumberOfView&lt;BR /&gt;&amp;nbsp;If iProperties.Value("Custom", "Surface") = "Raw" Or iProperties.Value("Custom", "Surface") = "Galv." Or iProperties.Value("Custom", "Surface") = "Colour 1" Or iProperties.Value("Custom", "Surface") = "Colour 2" Or iProperties.Value("Custom", "Surface") = "RAL 5003" Or iProperties.Value("Custom", "Surface") = "RAL 9010" Or iProperties.Value("Custom", "Surface") = "RAL 1028" Or iProperties.Value("Custom", "Surface") = "RAL 9005"&amp;nbsp; Or iProperties.Value("Custom", "Surface") = "EG-Galv" Or iProperties.Value("Custom", "Surface") = "HDG-Galv"&amp;nbsp; Then&lt;/P&gt;&lt;P&gt;oViewReps.Item(i).Activate&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;'---------------------&lt;BR /&gt;Dim oAsmDoc As AssemblyDocument&lt;BR /&gt;oAsmDoc = ThisDoc.Document&lt;BR /&gt;Dim oAsmCompDef As AssemblyComponentDefinition&lt;BR /&gt;oAsmCompDef = oAsmDoc.ComponentDefinition&lt;/P&gt;&lt;P&gt;Dim oOccurrence As ComponentOccurrence&lt;BR /&gt;For Each oOccurrence In oAsmCompDef.Occurrences&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;oAsmCompDef.ClearAppearanceOverrides(oOccurrence.name)&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;iLogicVb.UpdateWhenDone = True&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;'-------------------------&lt;BR /&gt;iLogicVb.UpdateWhenDone = True&lt;/P&gt;&lt;P&gt;Next&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>Mon, 14 Oct 2019 17:54:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/clear-overide-on-all-conponent-first-level-on-assambly/m-p/9085682#M102138</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2019-10-14T17:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Clear Overide on all Conponent(first level ) on assambly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clear-overide-on-all-conponent-first-level-on-assambly/m-p/9086650#M102151</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5708980"&gt;@Darkforce_the_ilogic_guy&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, method AssemblyComponentDefinition.&lt;STRONG&gt;ClearAppearanceOverrides&lt;/STRONG&gt;( [&lt;STRONG&gt;&lt;I&gt;AppearanceOverrideObjects&lt;/I&gt;&lt;/STRONG&gt;] As Variant ) would accept input parameter as object collection. Try below changes in your iLogic code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oAsmCompDef 'As AssemblyComponentDefinition

 
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
 
 Dim oViewReps As DesignViewRepresentations
oViewReps = oAsmCompDef.RepresentationsManager.DesignViewRepresentations


'define view rep
Dim oViewRep As DesignViewRepresentation


Dim NumberOfView = oViewReps.Count
' get Manager of Representations

 Dim dViewRepMgr As RepresentationsManager
 dViewRepMgr = oAsmCompDef.RepresentationsManager

 'Get active Representation View
 Dim dViewRep As DesignViewRepresentation
 dViewRep = dViewRepMgr.ActiveDesignViewRepresentation

 
 

For i = 1 To NumberOfView
 If iProperties.Value("Custom", "Surface") = "Raw" Or iProperties.Value("Custom", "Surface") = "Galv." Or iProperties.Value("Custom", "Surface") = "Colour 1" Or iProperties.Value("Custom", "Surface") = "Colour 2" Or iProperties.Value("Custom", "Surface") = "RAL 5003" Or iProperties.Value("Custom", "Surface") = "RAL 9010" Or iProperties.Value("Custom", "Surface") = "RAL 1028" Or iProperties.Value("Custom", "Surface") = "RAL 9005"  Or iProperties.Value("Custom", "Surface") = "EG-Galv" Or iProperties.Value("Custom", "Surface") = "HDG-Galv"  Then

oViewReps.Item(i).Activate
End If

'---------------------
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAsmDoc.ComponentDefinition

&lt;FONT color="#FF0000"&gt;Dim objColl As ObjectCollection 
objColl = ThisApplication.TransientObjects.CreateObjectCollection&lt;/FONT&gt; 

Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences

	&lt;FONT color="#FF0000"&gt;Call objColl.Add(oOccurrence)&lt;/FONT&gt;

 
 iLogicVb.UpdateWhenDone = True

Next
&lt;FONT color="#FF0000"&gt;oAsmCompDef.ClearAppearanceOverrides(objColl)&lt;/FONT&gt;
'-------------------------
iLogicVb.UpdateWhenDone = True

Next&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 06:44:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/clear-overide-on-all-conponent-first-level-on-assambly/m-p/9086650#M102151</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-10-15T06:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Clear Overide on all Conponent(first level ) on assambly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/clear-overide-on-all-conponent-first-level-on-assambly/m-p/9086750#M102153</link>
      <description>&lt;P&gt;It almost work I did have to delete 2 line of the code... but after that it look like it will work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oAsmCompDef 'As AssemblyComponentDefinition

 
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
 
 Dim oViewReps As DesignViewRepresentations
oViewReps = oAsmCompDef.RepresentationsManager.DesignViewRepresentations


'define view rep
Dim oViewRep As DesignViewRepresentation


Dim NumberOfView = oViewReps.Count
' get Manager of Representations

 Dim dViewRepMgr As RepresentationsManager
 dViewRepMgr = oAsmCompDef.RepresentationsManager

 'Get active Representation View
 Dim dViewRep As DesignViewRepresentation
 dViewRep = dViewRepMgr.ActiveDesignViewRepresentation

 
 

For i = 1 To NumberOfView
 If iProperties.Value("Custom", "Surface") = "Raw" Or iProperties.Value("Custom", "Surface") = "Galv." Or iProperties.Value("Custom", "Surface") = "Colour 1" Or iProperties.Value("Custom", "Surface") = "Colour 2" Or iProperties.Value("Custom", "Surface") = "RAL 5003" Or iProperties.Value("Custom", "Surface") = "RAL 9010" Or iProperties.Value("Custom", "Surface") = "RAL 1028" Or iProperties.Value("Custom", "Surface") = "RAL 9005"  Or iProperties.Value("Custom", "Surface") = "EG-Galv" Or iProperties.Value("Custom", "Surface") = "HDG-Galv"  Then

oViewReps.Item(i).Activate
End If

'---------------------
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisDoc.Document
&lt;STRIKE&gt;Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAsmDoc.ComponentDefinition&lt;/STRIKE&gt;

&lt;FONT color="#FF0000"&gt;Dim objColl As ObjectCollection 
objColl = ThisApplication.TransientObjects.CreateObjectCollection&lt;/FONT&gt; 

Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences

	&lt;FONT color="#FF0000"&gt;Call objColl.Add(oOccurrence)&lt;/FONT&gt;

 
 iLogicVb.UpdateWhenDone = True

Next
&lt;FONT color="#FF0000"&gt;oAsmCompDef.ClearAppearanceOverrides(objColl)&lt;/FONT&gt;
'-------------------------
iLogicVb.UpdateWhenDone = True

Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 08:02:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/clear-overide-on-all-conponent-first-level-on-assambly/m-p/9086750#M102153</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2019-10-15T08:02:15Z</dc:date>
    </item>
  </channel>
</rss>

