<?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: Hide component in a view on the drawing in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11341869#M140973</link>
    <description>&lt;P&gt;This is the function from my active project&lt;/P&gt;&lt;P&gt;This function will hides all occurrences in the "basView" except the "occ". Argument "asm" is referenced document of "baseView"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private static void HideOtherOccurrences(AssemblyDocument asm, ComponentOccurrence occ, DrawingView baseView)
{
    Point2d position = baseView.Position;
    foreach (ComponentOccurrence occurrence in asm.ComponentDefinition.Occurrences)
    {
        baseView.SetVisibility(occurrence, occurrence == occ);
    }

    baseView.Position = position;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2022 10:29:31 GMT</pubDate>
    <dc:creator>Michael.Navara</dc:creator>
    <dc:date>2022-08-05T10:29:31Z</dc:date>
    <item>
      <title>Hide component in a view on the drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11341836#M140972</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody have an example of a code used to hide a component in a certain view on the drawing?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added an assembly onto the sheet but I would like to hide&amp;nbsp;some components in one of the views (not all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;views).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anybody has an example please let me know.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 10:06:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11341836#M140972</guid>
      <dc:creator>tomislav.peran</dc:creator>
      <dc:date>2022-08-05T10:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Hide component in a view on the drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11341869#M140973</link>
      <description>&lt;P&gt;This is the function from my active project&lt;/P&gt;&lt;P&gt;This function will hides all occurrences in the "basView" except the "occ". Argument "asm" is referenced document of "baseView"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private static void HideOtherOccurrences(AssemblyDocument asm, ComponentOccurrence occ, DrawingView baseView)
{
    Point2d position = baseView.Position;
    foreach (ComponentOccurrence occurrence in asm.ComponentDefinition.Occurrences)
    {
        baseView.SetVisibility(occurrence, occurrence == occ);
    }

    baseView.Position = position;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 10:29:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11341869#M140973</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2022-08-05T10:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Hide component in a view on the drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11341931#M140975</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help. I apologize for my lack of understanding of how code works but If I put your code in Inventor I get a lot of errors. I assume this code is not used in Inventor?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like precisely the opposite then what your code does. To hide only one component in one of the projected views. And if possible in the form I can put in inventor like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawingDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&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;Sheet&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawingDoc&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;oView2&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView etc...&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I hope that I am making some sense &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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 10:54:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11341931#M140975</guid>
      <dc:creator>tomislav.peran</dc:creator>
      <dc:date>2022-08-05T10:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hide component in a view on the drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11342008#M140976</link>
      <description>&lt;P&gt;This code is written in C#. You need to convert them to iLogic/VB.net like this one. This code hides specific occurrence in the drawing view and show others.&lt;/P&gt;&lt;P&gt;If you want, you can keep hidden occurrences hidden (check&amp;nbsp;baseView.GetVisibility(occ)), pass multiple occurrences as parameter, etc.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub Main()

    Dim drw As DrawingDocument = ThisDoc.Document
    Dim baseView As DrawingView = drw.ActiveSheet.DrawingViews(1)
    Dim asm As AssemblyDocument = baseView.ReferencedDocumentDescriptor.ReferencedDocument
    Dim occ As ComponentOccurrence = asm.ComponentDefinition.Occurrences(1)

    HideOccurrence(asm, occ, baseView)

End Sub

Private Sub HideOccurrence(asm As AssemblyDocument, occ As ComponentOccurrence, baseView As DrawingView)

    Dim position As Point2d = baseView.Position
    For Each occurrence As ComponentOccurrence In asm.ComponentDefinition.Occurrences
        baseView.SetVisibility(occurrence, occurrence IsNot occ)
    Next

    baseView.Position = position
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 11:46:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11342008#M140976</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2022-08-05T11:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Hide component in a view on the drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11342085#M140980</link>
      <description>&lt;P&gt;Thanks, Michael,&amp;nbsp;I will look into it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Btw,&amp;nbsp; I have a friend who has been working as a Java developer for the last 20 years. He told me specifically to stay away from C# or C++ due to its complexity &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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tom&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 12:38:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11342085#M140980</guid>
      <dc:creator>tomislav.peran</dc:creator>
      <dc:date>2022-08-05T12:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Hide component in a view on the drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11348029#M141119</link>
      <description>&lt;P&gt;Here is what I had in mind. This is really part specific and can be used to show parts in the drawing which might be hidden in assembly. It is useful for standard assemblies/drawings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Found this&amp;nbsp;@&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/ilogic-to-remove-component-visibility-from-drawings-enviroment/td-p/4376079" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/ilogic-to-remove-component-visibility-from-drawings-enviroment/td-p/4376079&lt;/A&gt;&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;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDoc&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;oActiveSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;oActiveSheet&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;
    
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawingView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt;
&lt;SPAN&gt;oDrawingView&lt;/SPAN&gt; = &lt;SPAN&gt;oActiveSheet&lt;/SPAN&gt;.&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;(1)
    
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawingView&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedDocumentDescriptor&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedDocument&lt;/SPAN&gt;
    
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAssDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oAssDef&lt;/SPAN&gt; = &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
    
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;
	
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAssDef&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;
		
       &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"Arrow up:1"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;

          &lt;SPAN&gt;Call&lt;/SPAN&gt; &lt;SPAN&gt;oDrawingView&lt;/SPAN&gt;.&lt;SPAN&gt;SetVisibility&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;)
       &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	   
	   &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oOcc&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"Arrow down:1"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;

          &lt;SPAN&gt;Call&lt;/SPAN&gt; &lt;SPAN&gt;oDrawingView&lt;/SPAN&gt;.&lt;SPAN&gt;SetVisibility&lt;/SPAN&gt;(&lt;SPAN&gt;oOcc&lt;/SPAN&gt;, &lt;SPAN&gt;True&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;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 06:59:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-component-in-a-view-on-the-drawing/m-p/11348029#M141119</guid>
      <dc:creator>tomislav.peran</dc:creator>
      <dc:date>2022-08-09T06:59:50Z</dc:date>
    </item>
  </channel>
</rss>

