<?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 How to access to a certain drawing view in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651616#M113649</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to access to the detail view B (in green circle). To access "VISTA1", I know that I have to write the come something like..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim oDoc As Inventor.DrawingDocument&lt;/P&gt;&lt;P&gt;Dim oViewA As DrawingView&lt;BR /&gt;oViewA = oDoc.ActiveSheet.DrawingViews.Item(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot find how to access to a child view of drawing view. Can anyone help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, in the code below, what's the meaning of "1" in the part "Item(1)"? It sounds stupid but I tried Item(B), Item(2.B) etc etc and obviously didn't work at all....&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;oViewA = oDoc.ActiveSheet.DrawingViews.&lt;FONT color="#FF0000"&gt;Item(1)&lt;/FONT&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="Untitled.png" style="width: 236px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/798591iD16E090269073D9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 14:54:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-23T14:54:12Z</dc:date>
    <item>
      <title>How to access to a certain drawing view</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651616#M113649</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to access to the detail view B (in green circle). To access "VISTA1", I know that I have to write the come something like..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim oDoc As Inventor.DrawingDocument&lt;/P&gt;&lt;P&gt;Dim oViewA As DrawingView&lt;BR /&gt;oViewA = oDoc.ActiveSheet.DrawingViews.Item(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot find how to access to a child view of drawing view. Can anyone help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, in the code below, what's the meaning of "1" in the part "Item(1)"? It sounds stupid but I tried Item(B), Item(2.B) etc etc and obviously didn't work at all....&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;oViewA = oDoc.ActiveSheet.DrawingViews.&lt;FONT color="#FF0000"&gt;Item(1)&lt;/FONT&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="Untitled.png" style="width: 236px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/798591iD16E090269073D9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 14:54:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651616#M113649</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-23T14:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to access to a certain drawing view</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651764#M113656</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you working for 2021 inventory? Try this button it tells the way&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bandymas.jpg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/798611i2CF37C3DA8939627/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bandymas.jpg" alt="Bandymas.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 15:52:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651764#M113656</guid>
      <dc:creator>robertast</dc:creator>
      <dc:date>2020-07-23T15:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to access to a certain drawing view</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651777#M113658</link>
      <description>&lt;P&gt;If you know the name of the view, you could do this&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;kdrawingdocumentobject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Only works for drawings"&lt;/SPAN&gt;)
	&lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;oSheet&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Sheets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1)

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDetailView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oView&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"B"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;oDetailView&lt;/SPAN&gt; = &lt;SPAN&gt;oView&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jul 2020 15:57:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651777#M113658</guid>
      <dc:creator>ckeveryga</dc:creator>
      <dc:date>2020-07-23T15:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to access to a certain drawing view</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651798#M113659</link>
      <description>&lt;P&gt;Here is one way of getting that view.&lt;/P&gt;&lt;P&gt;And by the way, any time your iterating through members of a collection, there are "Item"s.&amp;nbsp; And they are indexed by Integers.&amp;nbsp; Even though, it doesn't say so in the clues, you can also enter a "quoted" string, instead of an Integer, that represents the name of the object (or view in your case).&lt;/P&gt;&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Drawing Documents.",vbOK, "WRONG DOCUMENT TYPE")
	Return
End If

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oDView As DetailDrawingView
For Each oSheet As Sheet In oDDoc.Sheets
	For Each oView As DrawingView In oSheet.DrawingViews
		If oView.ViewType = DrawingViewTypeEnum.kDetailDrawingViewType Then
			oDView = oView
		End If
	Next
Next&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Jul 2020 16:06:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9651798#M113659</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-07-23T16:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to access to a certain drawing view</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9652426#M113673</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp; Super! It works!! Thank you so much!!!&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@F982DDE76110C67DBDB6AF220B48480A/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 21:00:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-access-to-a-certain-drawing-view/m-p/9652426#M113673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-23T21:00:05Z</dc:date>
    </item>
  </channel>
</rss>

