<?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 Change view back to aktive view before running ilogic(Add colur to all View) in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8670011#M95772</link>
    <description>&lt;P&gt;I am making a complex illogic code... one thing that I&amp;nbsp;want it to do it to add a colour to all view on the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for now it work on part(Ipt)...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It change colour on all the view .. my problem is that I want it that o go want to the view that you where working on before running the code... I have a other code that do this ... but it is for assembly only ..... so I can´t just copy past that part of the code....but it work for assembly ... that I will have to make my code later paint a colour as well&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the code below create some standard view .. and go back to the view I work on ... how to I go back to the active view before I run the code on a part?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;' get Manager of Representations&lt;BR /&gt;&amp;nbsp;Dim dViewRepMgr As RepresentationsManager&lt;BR /&gt;&amp;nbsp;dViewRepMgr = oAsmCompDef.RepresentationsManager&lt;BR /&gt;&amp;nbsp;&lt;BR /&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;&lt;BR /&gt;'Dim AktivVeiw As String&lt;BR /&gt;'AktivVeiw = "Master"&lt;BR /&gt;'MessageBox.Show(AktivVeiw, "Info")&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;Try&lt;/P&gt;
&lt;P&gt;'create a list of view reps&lt;BR /&gt;For Each oViewRep In oViewReps&lt;BR /&gt;&amp;nbsp;NameList.Add(oViewRep.Name)&lt;BR /&gt;Next&lt;/P&gt;
&lt;P&gt;'check names&lt;BR /&gt;'-----------------------------------Tilføje Asset view ----------------------&lt;BR /&gt;'If NameList.Contains("Asset") = False&amp;nbsp;Then&lt;BR /&gt;&amp;nbsp;''set View Rep active&lt;BR /&gt;&amp;nbsp;'oViewRep = oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("Asset")&lt;BR /&gt;&amp;nbsp;'StandardViewCreate = True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'MessageBox.Show("Veiw Asset was created", "Info")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;'End If&lt;BR /&gt;'-----------------------------------Tilføje Asset view ----------------------&lt;BR /&gt;If NameList.Contains("Complete") = False Then&lt;BR /&gt;&amp;nbsp;'set View Rep active&lt;BR /&gt;&amp;nbsp;oViewRep = oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("Complete")&lt;BR /&gt;&amp;nbsp;StandardViewCreate = True&lt;BR /&gt;&amp;nbsp;'MessageBox.Show("Veiw Complete was created", "Info")&lt;BR /&gt;&amp;nbsp;End If&lt;BR /&gt;If NameList.Contains("Simplified") = False Then&lt;BR /&gt;&amp;nbsp;oViewRep = oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("Simplified")&lt;BR /&gt;&amp;nbsp;StandardViewCreate = True&lt;BR /&gt;&amp;nbsp;'MessageBox.Show("Veiw Simplified was created", "Info")&lt;BR /&gt;End If&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If StandardViewCreate = True Then&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;'Return to orginal aktiv veiw&lt;BR /&gt;&amp;nbsp; dViewRep.Activate&lt;BR /&gt;&amp;nbsp;'Tilføj denne nedestående kode igen hvis man ønsker en beked om at de sandard views er blevet lavet &lt;BR /&gt;&amp;nbsp;'MessageBox.Show("Standard veiws was created", "Info")&lt;BR /&gt;StandardViewCreate = False&lt;BR /&gt;End If&lt;BR /&gt;Catch&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;End Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;End If&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Catch&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;End Try&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2019 21:27:16 GMT</pubDate>
    <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
    <dc:date>2019-03-19T21:27:16Z</dc:date>
    <item>
      <title>Change view back to aktive view before running ilogic(Add colur to all View)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8670011#M95772</link>
      <description>&lt;P&gt;I am making a complex illogic code... one thing that I&amp;nbsp;want it to do it to add a colour to all view on the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for now it work on part(Ipt)...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It change colour on all the view .. my problem is that I want it that o go want to the view that you where working on before running the code... I have a other code that do this ... but it is for assembly only ..... so I can´t just copy past that part of the code....but it work for assembly ... that I will have to make my code later paint a colour as well&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the code below create some standard view .. and go back to the view I work on ... how to I go back to the active view before I run the code on a part?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;' get Manager of Representations&lt;BR /&gt;&amp;nbsp;Dim dViewRepMgr As RepresentationsManager&lt;BR /&gt;&amp;nbsp;dViewRepMgr = oAsmCompDef.RepresentationsManager&lt;BR /&gt;&amp;nbsp;&lt;BR /&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;&lt;BR /&gt;'Dim AktivVeiw As String&lt;BR /&gt;'AktivVeiw = "Master"&lt;BR /&gt;'MessageBox.Show(AktivVeiw, "Info")&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;Try&lt;/P&gt;
&lt;P&gt;'create a list of view reps&lt;BR /&gt;For Each oViewRep In oViewReps&lt;BR /&gt;&amp;nbsp;NameList.Add(oViewRep.Name)&lt;BR /&gt;Next&lt;/P&gt;
&lt;P&gt;'check names&lt;BR /&gt;'-----------------------------------Tilføje Asset view ----------------------&lt;BR /&gt;'If NameList.Contains("Asset") = False&amp;nbsp;Then&lt;BR /&gt;&amp;nbsp;''set View Rep active&lt;BR /&gt;&amp;nbsp;'oViewRep = oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("Asset")&lt;BR /&gt;&amp;nbsp;'StandardViewCreate = True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'MessageBox.Show("Veiw Asset was created", "Info")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;'End If&lt;BR /&gt;'-----------------------------------Tilføje Asset view ----------------------&lt;BR /&gt;If NameList.Contains("Complete") = False Then&lt;BR /&gt;&amp;nbsp;'set View Rep active&lt;BR /&gt;&amp;nbsp;oViewRep = oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("Complete")&lt;BR /&gt;&amp;nbsp;StandardViewCreate = True&lt;BR /&gt;&amp;nbsp;'MessageBox.Show("Veiw Complete was created", "Info")&lt;BR /&gt;&amp;nbsp;End If&lt;BR /&gt;If NameList.Contains("Simplified") = False Then&lt;BR /&gt;&amp;nbsp;oViewRep = oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("Simplified")&lt;BR /&gt;&amp;nbsp;StandardViewCreate = True&lt;BR /&gt;&amp;nbsp;'MessageBox.Show("Veiw Simplified was created", "Info")&lt;BR /&gt;End If&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If StandardViewCreate = True Then&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;'Return to orginal aktiv veiw&lt;BR /&gt;&amp;nbsp; dViewRep.Activate&lt;BR /&gt;&amp;nbsp;'Tilføj denne nedestående kode igen hvis man ønsker en beked om at de sandard views er blevet lavet &lt;BR /&gt;&amp;nbsp;'MessageBox.Show("Standard veiws was created", "Info")&lt;BR /&gt;StandardViewCreate = False&lt;BR /&gt;End If&lt;BR /&gt;Catch&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;End Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;End If&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Catch&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;End Try&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 21:27:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8670011#M95772</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2019-03-19T21:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change view back to aktive view before running ilogic(Add colur to all View)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8673698#M95834</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;Hoping that below iLogic code may be useful to activate active view. Before adding views, collect the active name view and then activate it after your task.&lt;/P&gt;
&lt;PRE&gt;Dim doc As AssemblyDocument
 doc = ThisApplication.ActiveDocument
 ' get AssemblyComponentDefinition
 Dim AssemblyDef As AssemblyComponentDefinition
 AssemblyDef = doc.ComponentDefinition
 ' get Manager of Representations
 Dim dViewRepMgr As RepresentationsManager
  dViewRepMgr = AssemblyDef.RepresentationsManager

Dim dViewRep As DesignViewRepresentation
 dViewRep = dViewRepMgr.ActiveDesignViewRepresentation
 
Dim oName As String 
oName = dViewRep.Name 

' get the first Representation view
  dViewRep = dViewRepMgr.DesignViewRepresentations.Item(oName)
 ' activate the first view
 dViewRep.Activate&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 08:51:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8673698#M95834</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-03-21T08:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Change view back to aktive view before running ilogic(Add colur to all View)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8673958#M95842</link>
      <description>&lt;P&gt;Look at your code it looks a lot like the Code i use for assambly ... the problem is that it will not work on a part (IPT file).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can you rewrite it for a part/ipt file&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 11:14:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8673958#M95842</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2019-03-21T11:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change view back to aktive view before running ilogic(Add colur to all View)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8674350#M95856</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;Try this,&lt;/P&gt;
&lt;PRE&gt;Dim doc As PartDocument
 doc = ThisApplication.ActiveDocument
 ' get AssemblyComponentDefinition
 Dim partDef As PartComponentDefinition 
 partDef = doc.ComponentDefinition
 ' get Manager of Representations
 Dim dViewRepMgr As RepresentationsManager
  dViewRepMgr = partDef.RepresentationsManager

Dim dViewRep As DesignViewRepresentation
 dViewRep = dViewRepMgr.ActiveDesignViewRepresentation
 
Dim oName As String 
oName = dViewRep.Name 

' get the first Representation view
  dViewRep = dViewRepMgr.DesignViewRepresentations.Item(oName)
 ' activate the first view
 dViewRep.Activate&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 13:38:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8674350#M95856</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-03-21T13:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change view back to aktive view before running ilogic(Add colur to all View)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8675515#M95889</link>
      <description>&lt;P&gt;it seems to work ... now I just need to find a right way to intergrade it into my other code thanks&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 19:58:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/change-view-back-to-aktive-view-before-running-ilogic-add-colur/m-p/8675515#M95889</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2019-03-21T19:58:04Z</dc:date>
    </item>
  </channel>
</rss>

