<?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: Working with Assembly Design View Representation in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8946231#M72792</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code may not work properly in Non-English environments.&lt;/P&gt;&lt;PRE&gt;    If oActiveDVR.Name = "Master" Then j = 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have run this test code in Inventor with Japanese language pack,&lt;/P&gt;&lt;PRE&gt;Sub test()
    Dim rm As RepresentationsManager
    Set rm = ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager

    Debug.Print "Name  : " &amp;amp; rm.ActiveDesignViewRepresentation.Name
    Debug.Print "Test1 : " &amp;amp; (rm.ActiveDesignViewRepresentation.Name = "Master")
    Debug.Print "Test2 : " &amp;amp; (rm.ActiveDesignViewRepresentation.Name = rm.DesignViewRepresentations(1).Name)
    Debug.Print "Test3 : " &amp;amp; (rm.ActiveDesignViewRepresentation.DesignViewType = kTransientDesignViewType)
End Sub&lt;/PRE&gt;&lt;P&gt;and got the result as below.&lt;/P&gt;&lt;PRE&gt;Name  : マスター
Test1 : False
Test2 : True
Test3 : True&lt;/PRE&gt;&lt;P&gt;The name "マスター" means "Master" in Japanese.&lt;/P&gt;&lt;P&gt;I don't understand exactly what kTransientDesignViewType means, but Test3 seems to work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 03 Aug 2019 04:15:09 GMT</pubDate>
    <dc:creator>HideoYamada</dc:creator>
    <dc:date>2019-08-03T04:15:09Z</dc:date>
    <item>
      <title>Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8943943#M72789</link>
      <description>&lt;P&gt;Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am developing code (VBA) that will create drawing views from assembly Design View Representations (DVRs).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this code, I can get the count and names of the DVRs:&lt;/P&gt;&lt;PRE&gt;Public Sub ListDesignViewReps()
    Dim oView As Inventor.DesignViewRepresentation
    Dim oCompDef As ComponentDefinition
    Set oCompDef = ThisApplication.ActiveDocument.ComponentDefinition
    MsgBox ("Number of DVRs: " &amp;amp; oCompDef.RepresentationsManager.DesignViewRepresentations.Count)
    For Each oView In oCompDef.RepresentationsManager.DesignViewRepresentations
        MsgBox ("DVR Name: " &amp;amp; oView.Name)
    Next
End Sub&lt;/PRE&gt;&lt;P&gt;However, if the Master DVR is active, the number of DVRs reported is Actual + 1.&lt;/P&gt;&lt;P&gt;For example, an assembly with a Master and Default DVR will report a count of 3 and Master is listed twice.&lt;/P&gt;&lt;P&gt;If Default is active, the count reports as 2 and Master is listed only once.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone explain why having the Master DVR active changes the actual count?&lt;/P&gt;&lt;P&gt;I can likely workaround this issue, but I found it confusing. I have not tested with Pos Reps or LODs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jerry&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 19:47:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8943943#M72789</guid>
      <dc:creator>JBerns</dc:creator>
      <dc:date>2019-08-01T19:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8944915#M72790</link>
      <description>&lt;P&gt;Hi, I really don't know why this error appears. I can only suggest you avoid it.&lt;BR /&gt;Then I share a VBA code that may solve this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub ListDesignViewReps()
    Dim oView As Inventor.DesignViewRepresentation
    Dim oCompDef As ComponentDefinition
    Set oCompDef = ThisApplication.ActiveDocument.ComponentDefinition
    Dim oActiveDVR As Inventor.DesignViewRepresentation
    Set oActiveDVR = oCompDef.RepresentationsManager.ActiveDesignViewRepresentation

    Dim j As Integer, i As Integer
    j = 0
    
    If oActiveDVR.Name = "Master" Then j = 1
    
    MsgBox ("Number of DVRs: " &amp;amp; oCompDef.RepresentationsManager.DesignViewRepresentations.Count - j)
   
   For i = 1 To oCompDef.RepresentationsManager.DesignViewRepresentations.Count - j
    
        Set oView = oCompDef.RepresentationsManager.DesignViewRepresentations(i)
        oView.Activate
        
        MsgBox ("DVR Name: " &amp;amp; oView.Name)
    Next
End Sub&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I hope I can be useful. regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 11:15:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8944915#M72790</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-08-02T11:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8945017#M72791</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4253164"&gt;@Sergio.D.Suárez&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a peculiar behavior. I was able to test Pos Reps and LODs. Neither of these exhibit the varying count behavior as the DVRs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My plan is to filter for specifically named DVRs, so I should be able to avoid the issue with the Master DVR. Thank you for the code though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, I need to code to create a new drawing from an assembly and then a sufficient number of sheets based on the number of DVRs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 12:19:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8945017#M72791</guid>
      <dc:creator>JBerns</dc:creator>
      <dc:date>2019-08-02T12:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8946231#M72792</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code may not work properly in Non-English environments.&lt;/P&gt;&lt;PRE&gt;    If oActiveDVR.Name = "Master" Then j = 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have run this test code in Inventor with Japanese language pack,&lt;/P&gt;&lt;PRE&gt;Sub test()
    Dim rm As RepresentationsManager
    Set rm = ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager

    Debug.Print "Name  : " &amp;amp; rm.ActiveDesignViewRepresentation.Name
    Debug.Print "Test1 : " &amp;amp; (rm.ActiveDesignViewRepresentation.Name = "Master")
    Debug.Print "Test2 : " &amp;amp; (rm.ActiveDesignViewRepresentation.Name = rm.DesignViewRepresentations(1).Name)
    Debug.Print "Test3 : " &amp;amp; (rm.ActiveDesignViewRepresentation.DesignViewType = kTransientDesignViewType)
End Sub&lt;/PRE&gt;&lt;P&gt;and got the result as below.&lt;/P&gt;&lt;PRE&gt;Name  : マスター
Test1 : False
Test2 : True
Test3 : True&lt;/PRE&gt;&lt;P&gt;The name "マスター" means "Master" in Japanese.&lt;/P&gt;&lt;P&gt;I don't understand exactly what kTransientDesignViewType means, but Test3 seems to work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2019 04:15:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/8946231#M72792</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-08-03T04:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/9346014#M72793</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You have 3 DVR because "Master" view is active &lt;U&gt;and&lt;/U&gt; "Master" view is &lt;STRONG&gt;locked&lt;/STRONG&gt; so Inventor make a transient view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you locked "view1" and activate this, you have 3 DVR too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You must filter with &lt;FONT&gt;DesignViewType &lt;/FONT&gt;:&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - kTransientDesignViewType ==&amp;gt; Create if active view is locked&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - kMasterDesignViewType ==&amp;gt; For Master view&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - kPublicDesignViewType ==&amp;gt; For all other views&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;François&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 15:30:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/9346014#M72793</guid>
      <dc:creator>fransoze</dc:creator>
      <dc:date>2020-02-27T15:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/9351065#M72794</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; While run this script if active design view rep is in locked condition it will be counted as 2. That particular rep will be counted as 2. Except master others should be unlocked condition. better before you count unlock all rep and active default view rep then start count. Hope this will help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Karth&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 12:19:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/9351065#M72794</guid>
      <dc:creator>k14348</dc:creator>
      <dc:date>2020-03-01T12:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/9351094#M72795</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Hope this script solves your prob.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Option Explicit

Public Sub DesignViewRep()
    Dim oAsmDoc As AssemblyDocument
    Set oAsmDoc = ThisApplication.ActiveDocument
    
    Dim oRepMgr As RepresentationsManager
    Set oRepMgr = oAsmDoc.ComponentDefinition.RepresentationsManager
    
    Dim oDVRs As DesignViewRepresentations
    Set oDVRs = oRepMgr.DesignViewRepresentations
    
    Dim oDVR As DesignViewRepresentation
    
    For Each oDVR In oDVRs
        On Error Resume Next
        oDVR.Locked = False
    Next
    
    oDVRs.Item("Default").Activate
    
    MsgBox ("Total No. of DVRs: " &amp;amp; oDVRs.Count)
    
    For Each oDVR In oDVRs
        MsgBox ("DVR Name: " &amp;amp; oDVR.Name)
    Next
   
End Sub
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Karth&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 12:48:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/9351094#M72795</guid>
      <dc:creator>k14348</dc:creator>
      <dc:date>2020-03-01T12:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/9374175#M72796</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/555733"&gt;@HideoYamada&lt;/a&gt;&amp;nbsp;/&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5809584"&gt;@fransoze&lt;/a&gt;&amp;nbsp;/&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1060254"&gt;@k14348&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all for the information, explanations, and code. I look forward to using these solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 12:56:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/9374175#M72796</guid>
      <dc:creator>JBerns</dc:creator>
      <dc:date>2020-03-12T12:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Assembly Design View Representation</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/11165579#M72797</link>
      <description>Good and clear explanation, it helped me, Thanks!</description>
      <pubDate>Thu, 12 May 2022 20:16:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/working-with-assembly-design-view-representation/m-p/11165579#M72797</guid>
      <dc:creator>vinayababu.yerneni</dc:creator>
      <dc:date>2022-05-12T20:16:18Z</dc:date>
    </item>
  </channel>
</rss>

