<?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: Update all views in a sheet to turn on Associative check box in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342831#M81642</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1262283"&gt;@NachoShaw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Starting to make sense.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Default is our preferred view rep.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So took you code and swapped it out with what I had...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting this error now...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="steveh_0-1659722586998.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1100942iC02F81FF67127D40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="steveh_0-1659722586998.png" alt="steveh_0-1659722586998.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2022 18:03:14 GMT</pubDate>
    <dc:creator>steveh3</dc:creator>
    <dc:date>2022-08-05T18:03:14Z</dc:date>
    <item>
      <title>Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8420334#M81625</link>
      <description>&lt;P&gt;Hello together,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is there a solution to turn on associative check box in a drawing? How to get the ActiveDesignViewRepresentation name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oDrawView As DrawingView&lt;BR /&gt;
For Each oSheet In oDrawDoc.Sheets
For Each oDrawView In oSheet.DrawingViews
Representation = oDrawView.ActiveDesignViewRepresentation
If Representation &amp;lt;&amp;gt; "" Then

'  How to get the name
'oDrawView.SetDesignViewRepresentation(Representation, True)
End If
Next
Next&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Zeichnungsansicht.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/572887i52E49A9E9C0CF6D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Zeichnungsansicht.png" alt="Zeichnungsansicht.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Thank you&lt;/P&gt;
&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 11:00:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8420334#M81625</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2018-11-23T11:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8424309#M81626</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Available design view representations in assembly can be used to check associativity for drawing view in Drawing document. For example, a drawing document contains drawing view which is referenced by assembly&amp;nbsp;document having 2 design view representations namely, &lt;STRONG&gt;"Master"&lt;/STRONG&gt; and &lt;STRONG&gt;"Complete".&lt;/STRONG&gt; Before running below VBA code, property of drawing view is look like below&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="Before.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/573643i2FB1C7AA82136757/image-size/large?v=v2&amp;amp;px=999" role="button" title="Before.png" alt="Before.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Check_Associativity()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oSheet As Sheet
    Set oSheet = oDoc.ActiveSheet
    
    Dim oView As DrawingView
    Set oView = oSheet.DrawingViews.Item(1)
    
    Call oView.SetDesignViewRepresentation("Complete", True)
End Sub&lt;/PRE&gt;
&lt;P&gt;After running above code, property of drawing view shows that it is checked out to &lt;STRONG&gt;"Complete"&lt;/STRONG&gt; design view representation as shown below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="After.png" style="width: 961px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/573644i6EBF82847EBC4508/image-size/large?v=v2&amp;amp;px=999" role="button" title="After.png" alt="After.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 12:18:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8424309#M81626</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-11-26T12:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8424436#M81627</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes I know this. But how could I get the view list (names) like "Complete"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you Georg&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 13:30:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8424436#M81627</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2018-11-26T13:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8424684#M81628</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;.&amp;nbsp;In order to check the "Associative" box via the API, you have to specify the name of the View Rep to be associative to. And unfortunately, there's currently no way to determine which View Rep is the "current" View Rep for the drawing view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a look at this helpful post by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;:&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/ilogic-to-lock-views-in-drawing/m-p/6574383/highlight/true#M66923" target="_blank"&gt;Re: Ilogic to lock views in drawing&lt;/A&gt;&amp;nbsp;(see post 15).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What MAY be possible is to determine the View Reps present in the Assembly/Part the drawing view belongs to, and you could either always use the first one, or use one that meets some criteria that you're looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, as of now there's unfortunately no way to simply check the "Associative" box for the current View Rep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your vote on this functionality request will help get this fixed:&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/api-improvement-reassociate-a-drawing-view-with-its-design-view/idi-p/8335016" target="_blank"&gt;API improvement: Reassociate a Drawing View with its Design View Representation&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 14:41:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8424684#M81628</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2018-11-26T14:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8424989#M81629</link>
      <description>&lt;P&gt;Here's a really annoying way to bring up the edit view dialog for any view that isn't already set to Associative.&lt;/P&gt;
&lt;PRE&gt;Dim app As Application
Set app = ThisApplication
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = app.ActiveDocument
Dim oSheet As Sheet
Dim ViewEdit As ControlDefinition
Set ViewEdit = app.CommandManager.ControlDefinitions("DrawingViewEditCtxCmd")
For Each oSheet In oDrawDoc.Sheets
    For Each oDrawView In oSheet.DrawingViews
        Representation = oDrawView.ActiveDesignViewRepresentation
        If Representation = "" Then
            oDrawDoc.SelectSet.Clear
            oDrawDoc.SelectSet.Select (oDrawView)
            ViewEdit.Execute2 True
        End If
    Next
Next&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Nov 2018 16:05:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8424989#M81629</guid>
      <dc:creator>clutsa</dc:creator>
      <dc:date>2018-11-26T16:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8425343#M81630</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A few years ago i did some extensive coding related to View Reps as we needed to be able to specifically change to a view. In that code, im sure i was able to determine what the current view rep was however, i aborted the project because there was at the time, a 8 year bug that wouldn't allow me to change the view rep by code. If thats since changed (which i doubt), great. If not, the whole API on view reps is a waste of time as you cant do anything with it except change the associative check box (only if its not on the master view)&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 18:16:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8425343#M81630</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2018-11-26T18:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8426456#M81631</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5352440"&gt;@clutsa&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thank you very much for your solution. Is there no way to check it automatically?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1262283"&gt;@NachoShaw&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Please could you post your code or send me a pm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Is it possible that you add it to the change request (API)?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 07:30:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8426456#M81631</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2018-11-27T07:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8427441#M81632</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;The problem I'm running into is I can't figure out what DesignViewRep the drawing view is set to until it's set to associative. Once that is set the "ActiveDesignViewRepresentation" returns real data again and I have something to work with. I can turn it on automatically but will change the DesignViewRep of the view and most likely compromise the integrity of the drawing.&lt;/P&gt;
&lt;P&gt;We could pop up a dialog and ask what DVRep to set all the views to or go one step farther and ask what DVRep and which views but at that point your doing as much if not more work to get it set.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 14:52:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8427441#M81632</guid>
      <dc:creator>clutsa</dc:creator>
      <dc:date>2018-11-27T14:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8427487#M81633</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;Thank you very much for your solution. Is there no way to check it automatically?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;, please see my post above (post # 4). I explain why there currently is no way to check it automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your best bet for efficiently and quickly setting every view to associative is going to be clutsa's code in post #5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;Is it possible that you add it to the change request (API)?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My post above also included a link to a change request that's already been created. Please vote for it if you'd like to see this fixed:&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/api-improvement-reassociate-a-drawing-view-with-its-design-view/idi-p/8335016" target="_blank"&gt;API improvement: Reassociate a Drawing View with its Design View Representation&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 15:07:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8427487#M81633</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2018-11-27T15:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8429216#M81634</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/241746"&gt;@GeorgK&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In continuing with same example drawing with 2 design view representations, try below VBA code to change and associate DesignViewRepresentation. In general,&amp;nbsp;"Master" DesignViewRepresentation always returns null string value for Drawing view(oView.ActiveDesignViewRepresentation).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Check_Associativity()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oSheet As Sheet
    Set oSheet = oDoc.ActiveSheet
    
    Dim oView As DrawingView
    Set oView = oSheet.DrawingViews.Item(1)
    
    If oView.ActiveDesignViewRepresentation = "" Then
        If oView.ReferencedDocumentDescriptor.ReferencedDocumentType = kAssemblyDocumentObject Then
        
            Dim oAssyDoc As AssemblyDocument
            Set oAssyDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
            
            Dim oAssyDef As AssemblyComponentDefinition
            Set oAssyDef = oAssyDoc.ComponentDefinition
            
            Dim oDesignView As DesignViewRepresentation
            For Each oDesignView In oAssyDef.RepresentationsManager.DesignViewRepresentations
                If Not oDesignView.Name = "Master" Then
                    Call oView.SetDesignViewRepresentation(oDesignView.Name, True)
                    Exit For
                End If
            Next
        End If
    End If
     
End Sub&lt;/PRE&gt;
&lt;P&gt;Please feel free to contact if there is any queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 05:19:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8429216#M81634</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-11-28T05:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8433585#M81635</link>
      <description>&lt;P&gt;That should work great if you only have two design views (master and some other view) but what if you have two or three design views &lt;STRONG&gt;other&lt;/STRONG&gt; then master? It's always going to end up as the last design view and that could/would compromise the drawing. Inventor should have some way to figure out what design view the drawing view was last set to (the "Edit View" dialog box can figure it out, so it has to be somewhere)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 15:28:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/8433585#M81635</guid>
      <dc:creator>clutsa</dc:creator>
      <dc:date>2018-11-29T15:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342454#M81636</link>
      <description>&lt;P&gt;Is there any way to get this to run when views come from an .iam?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 15:16:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342454#M81636</guid>
      <dc:creator>steveh3</dc:creator>
      <dc:date>2022-08-05T15:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342457#M81637</link>
      <description>&lt;P&gt;To be more specific....I don't want this routine to run when the idw views are from an ipt. We get prompted for every view because it doesn't apply to .ipt's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only want this routine to run when the view is from an .iam.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code I used from above...&lt;/P&gt;&lt;PRE&gt;Dim app As Application
Set app = ThisApplication
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = app.ActiveDocument
Dim oSheet As Sheet
Dim ViewEdit As ControlDefinition
Set ViewEdit = app.CommandManager.ControlDefinitions("DrawingViewEditCtxCmd")
For Each oSheet In oDrawDoc.Sheets
    For Each oDrawView In oSheet.DrawingViews
        Representation = oDrawView.ActiveDesignViewRepresentation
        If Representation = "" Then
            oDrawDoc.SelectSet.Clear
            oDrawDoc.SelectSet.Select (oDrawView)
            ViewEdit.Execute2 True
        End If
    Next
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 15:19:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342457#M81637</guid>
      <dc:creator>steveh3</dc:creator>
      <dc:date>2022-08-05T15:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342463#M81638</link>
      <description>&lt;P&gt;Also...any way to just toggle it on and have no user intervention?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 15:20:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342463#M81638</guid>
      <dc:creator>steveh3</dc:creator>
      <dc:date>2022-08-05T15:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342477#M81639</link>
      <description>&lt;P&gt;you could get the underlying files type from the Reference Descriptor and only run it if its an assembly in a Select statement?&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4427777"&gt;@chandra.shekar.g&lt;/a&gt;&amp;nbsp;has already provided an example of that in post #10&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>Fri, 05 Aug 2022 15:27:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342477#M81639</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2022-08-05T15:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342610#M81640</link>
      <description>&lt;P&gt;So, I grabbed the code from #10.&lt;/P&gt;&lt;P&gt;For views with iam's, it prompts me with the view dialog box when the Associativity is not toggled. I then toggle the Associative check box and all is good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, when I run the code when the view is an .ipt (Master is the View Rep for all views), I'm still getting prompted with the dialog....&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="steveh_0-1659716461508.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1100900iE35C9AEDD23880B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="steveh_0-1659716461508.png" alt="steveh_0-1659716461508.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't know VBA but, I'm thinking, the code should skip the dialog box when the view&amp;nbsp; rep is Master. Am I correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 16:25:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342610#M81640</guid>
      <dc:creator>steveh3</dc:creator>
      <dc:date>2022-08-05T16:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342712#M81641</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you're getting the dialog box because you're asking for it here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Set ViewEdit = app.CommandManager.ControlDefinitions("DrawingViewEditCtxCmd")
'other code
ViewEdit.Execute2 True&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;Also, you are setting the ViewRepresentation to do something if the value is ""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Representation = oDrawView.ActiveDesignViewRepresentation
If Representation = "" Then&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at worst, the ViewRep would be Master. You cannot set association with a Master view rep. In this code below, it checks for the document type and only executes if its an assembly. Then it sets the DesignViewRep to "Default" (which is one i made up to test the code so you should change Default to your own)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;oDrawView.SetDesignViewRepresentation("Default", True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is setting the viewrep to the currently active drawing view to the view rep you want and setting the association to True.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim app As Application: Set app = ThisApplication
Dim oDrawDoc As DrawingDocument: Set oDrawDoc = app.ActiveDocument
Dim oSheet As Sheet

For Each oSheet In oDrawDoc.Sheets
    Dim oDrawView As DrawingView
    For Each oDrawView In oSheet.DrawingViews	
       If oDrawView.ReferencedDocumentDescriptor.ReferencedDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
          Dim Rep As DesignViewRepresentation = oDrawView.ActiveDesignViewRepresentation
				oDrawView.SetDesignViewRepresentation("Default", True)
		End If      
    Next
Next&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;let me know if this works for you and i can help you out&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 17:04:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342712#M81641</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2022-08-05T17:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342831#M81642</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1262283"&gt;@NachoShaw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Starting to make sense.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Default is our preferred view rep.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So took you code and swapped it out with what I had...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting this error now...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="steveh_0-1659722586998.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1100942iC02F81FF67127D40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="steveh_0-1659722586998.png" alt="steveh_0-1659722586998.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 18:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342831#M81642</guid>
      <dc:creator>steveh3</dc:creator>
      <dc:date>2022-08-05T18:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342834#M81643</link>
      <description>&lt;P&gt;you could delete that line, i was a version of your original line but its now redundant in my code&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 18:04:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342834#M81643</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2022-08-05T18:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Update all views in a sheet to turn on Associative check box</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342837#M81644</link>
      <description>&lt;P&gt;The reason for the error is the string construction. I write in VB.Net which is slightly different to VBA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;VB.NET&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim Rep As DesignViewRepresentation = oDrawView.ActiveDesignViewRepresentation&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VBA&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim Rep As DesignViewRepresentation 
Set Rep = oDrawView.ActiveDesignViewRepresentation&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in VBA you can also compact the string buts the same thing&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim Rep As DesignViewRepresentation: Set Rep = oDrawView.ActiveDesignViewRepresentation&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 18:08:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/update-all-views-in-a-sheet-to-turn-on-associative-check-box/m-p/11342837#M81644</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2022-08-05T18:08:32Z</dc:date>
    </item>
  </channel>
</rss>

