<?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 iLogic to Read Current View Representation in Part File in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890380#M109732</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm looking for the iLogic code to read which view rep is currently active in a part file so that I can then perform a few mods to the part via IF statements. I can't however find a way to read the active view representation from existing snippets or forum posts.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Example....&lt;/P&gt;&lt;PRE&gt;Dim oViewRep as ??????????????????????&lt;BR /&gt;&lt;BR /&gt;If oViewRep = "View1" Then
Mods to part...
Else
Other mods to part....&amp;nbsp;
End If&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Any help on reading the existing view rep would be appreciated.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2019 12:02:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-04T12:02:47Z</dc:date>
    <item>
      <title>iLogic to Read Current View Representation in Part File</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890380#M109732</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm looking for the iLogic code to read which view rep is currently active in a part file so that I can then perform a few mods to the part via IF statements. I can't however find a way to read the active view representation from existing snippets or forum posts.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Example....&lt;/P&gt;&lt;PRE&gt;Dim oViewRep as ??????????????????????&lt;BR /&gt;&lt;BR /&gt;If oViewRep = "View1" Then
Mods to part...
Else
Other mods to part....&amp;nbsp;
End If&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Any help on reading the existing view rep would be appreciated.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 12:02:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890380#M109732</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-04T12:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic to Read Current View Representation in Part File</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890512#M109733</link>
      <description>&lt;P&gt;Hello, With this code you can read what is the view of active representation in your part or assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;Document&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;  
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt; 

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;ActViewRep&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;RepresentationsManager&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDesignViewRepresentation&lt;/SPAN&gt;.&lt;SPAN&gt;name&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;ActPosRep&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;RepresentationsManager&lt;/SPAN&gt;.&lt;SPAN&gt;ActivePositionalRepresentation&lt;/SPAN&gt;.&lt;SPAN&gt;name&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;ActLOD&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;RepresentationsManager&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveLevelOfDetailRepresentation&lt;/SPAN&gt;.&lt;SPAN&gt;name&lt;/SPAN&gt;

&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;ActViewRep&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I hope it will be useful to develop what you need. regards&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 13:12:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890512#M109733</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-07-04T13:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic to Read Current View Representation in Part File</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890560#M109734</link>
      <description>&lt;P&gt;Thank you for the code! This seems to work for an assembly but not for a part.&lt;BR /&gt;&lt;BR /&gt;I get the following error:&lt;/P&gt;&lt;PRE&gt;Object variable or With block variable not set.&lt;/PRE&gt;&lt;PRE&gt;System.NullReferenceException: Object variable or With block variable not set.
   at Microsoft.VisualBasic.CompilerServices.Symbols.Container..ctor(Object Instance)
   at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
   at LmiRuleScript.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jul 2019 13:40:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890560#M109734</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-04T13:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic to Read Current View Representation in Part File</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890566#M109735</link>
      <description>&lt;P&gt;Ignore that!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Works for parts if I remove the positional and LOD lines since they are not available in an ipt.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for the help &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 13:42:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-to-read-current-view-representation-in-part-file/m-p/8890566#M109735</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-04T13:42:38Z</dc:date>
    </item>
  </channel>
</rss>

