<?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 Turn of the visibility of a solid body in a drawing view with iLogic in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11732991#M148709</link>
    <description>&lt;P&gt;Hi everybody !&lt;/P&gt;&lt;P&gt;I would like to acces the visibility command that we have for the solid body in a view.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jgomisext_0-1675688865771.png" style="width: 333px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1172200iF02607222491A2DE/image-dimensions/333x373?v=v2" width="333" height="373" role="button" title="jgomisext_0-1675688865771.png" alt="jgomisext_0-1675688865771.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have wrote a code to do it with iLogic but it's not working well. My code change the visibility in my part and not only in the model tree of my view.&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;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;oSheet&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&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;oView&lt;/SPAN&gt; = &lt;SPAN&gt;oSheet&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;Document&lt;/SPAN&gt; 
&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; = &lt;SPAN&gt;oView&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;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oCompDef&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;oSB1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SurfaceBody&lt;/SPAN&gt; 
&lt;SPAN&gt;oSB1&lt;/SPAN&gt; = &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceBodies&lt;/SPAN&gt;(2)

&lt;SPAN&gt;oSB1&lt;/SPAN&gt;.&lt;SPAN&gt;Visible&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Do someone know what I'm doing wrong ?&lt;/P&gt;&lt;P&gt;Thanks for anyhelp ! &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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 13:11:27 GMT</pubDate>
    <dc:creator>jgomis.ext</dc:creator>
    <dc:date>2023-02-06T13:11:27Z</dc:date>
    <item>
      <title>Turn of the visibility of a solid body in a drawing view with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11732991#M148709</link>
      <description>&lt;P&gt;Hi everybody !&lt;/P&gt;&lt;P&gt;I would like to acces the visibility command that we have for the solid body in a view.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jgomisext_0-1675688865771.png" style="width: 333px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1172200iF02607222491A2DE/image-dimensions/333x373?v=v2" width="333" height="373" role="button" title="jgomisext_0-1675688865771.png" alt="jgomisext_0-1675688865771.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have wrote a code to do it with iLogic but it's not working well. My code change the visibility in my part and not only in the model tree of my view.&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;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;oSheet&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&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;oView&lt;/SPAN&gt; = &lt;SPAN&gt;oSheet&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;Document&lt;/SPAN&gt; 
&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; = &lt;SPAN&gt;oView&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;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oCompDef&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;oSB1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SurfaceBody&lt;/SPAN&gt; 
&lt;SPAN&gt;oSB1&lt;/SPAN&gt; = &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceBodies&lt;/SPAN&gt;(2)

&lt;SPAN&gt;oSB1&lt;/SPAN&gt;.&lt;SPAN&gt;Visible&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Do someone know what I'm doing wrong ?&lt;/P&gt;&lt;P&gt;Thanks for anyhelp ! &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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 13:11:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11732991#M148709</guid>
      <dc:creator>jgomis.ext</dc:creator>
      <dc:date>2023-02-06T13:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Turn of the visibility of a solid body in a drawing view with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11733008#M148710</link>
      <description>&lt;P&gt;-&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 13:22:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11733008#M148710</guid>
      <dc:creator>Daan_M</dc:creator>
      <dc:date>2023-02-06T13:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Turn of the visibility of a solid body in a drawing view with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11733011#M148711</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I don't want to supress my view, I just want to use only some body solid in my view...&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 13:22:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11733011#M148711</guid>
      <dc:creator>jgomis.ext</dc:creator>
      <dc:date>2023-02-06T13:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Turn of the visibility of a solid body in a drawing view with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11733296#M148717</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13134933"&gt;@jgomis.ext&lt;/a&gt;.&amp;nbsp; You will need at least one custom &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=DesignViewRepresentation" target="_blank" rel="noopener"&gt;DesignViewRepresentation&lt;/A&gt; in your&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=DesignViewRepresentations" target="_blank" rel="noopener"&gt;DesignViewRepresentaions&lt;/A&gt;&amp;nbsp;collection to accomplish what you are trying to do.&amp;nbsp; Then that one drawing view will have to be set to that custom DVR, so that the body visibility differences needed for that view do not effect the other drawing views.&amp;nbsp; Once that custom DVR exists in your 'model' file, you can do either of the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1a)&amp;nbsp; Set the visibility of those bodies in the model, while that custom DVR is active, so those settings get recorded.&lt;/P&gt;
&lt;P&gt;1b)&amp;nbsp; Set the drawing view to that DVR, then check the checkbox next for 'Associative' to link it.&lt;/P&gt;
&lt;P&gt;1c)&amp;nbsp; Do not attempt to further adjust any visibility of stuff in that drawing view.&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;2a)&amp;nbsp; Do not mess with visibility in the model directly, but do set the drawing view to that custom DVR, but then do not check the checkbox for 'Associative', because you will be adjusting body visibility from the drawing side, which would break any associativity.&amp;nbsp; Body visibility will still be effecting the model, but only that one custom DVR version of the model, if things are done right.&amp;nbsp; Leaving your other drawing views (which are set to the 'Master/Locked' DVR, instead of the custom one) alone/unchanged.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 15:06:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11733296#M148717</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-02-06T15:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Turn of the visibility of a solid body in a drawing view with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11733342#M148718</link>
      <description>&lt;P&gt;By the way, here is another route for controlling the visibility of SurfaceBody geometry within a drawing view of a multi-body part.&amp;nbsp; This simple example uses a property of the DrawingView object called DrawingCurves, which will retrieve all view geometry for the model reference you input into it.&amp;nbsp; Then you can loop through the contents of that collection of geometry to turn the visibility of the geometry off.&amp;nbsp; This example is just getting the first view on the active sheet of the drawing, then attempting to get the third body in the part, but you can change any of that as needed.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oView As DrawingView = oDDoc.ActiveSheet.DrawingViews.Item(1)
Dim oModel As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
If oModel.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
	Dim oPDoc As PartDocument = oModel
	If oPDoc.ComponentDefinition.HasMultipleSolidBodies = False Then Exit Sub
	Dim oBodies As SurfaceBodies = oPDoc.ComponentDefinition.SurfaceBodies
	Dim oBody3 As SurfaceBody = oBodies.Item(3)
	Dim oBodyGeomInView As DrawingCurvesEnumerator = oView.DrawingCurves(oBody3)
	If oBodyGeomInView.Count = 0 Then Exit Sub
	For Each oDC As DrawingCurve In oBodyGeomInView
		For Each oDCS As DrawingCurveSegment In oDC.Segments
			oDCS.Visible = False
		Next
	Next
End If&lt;/LI-CODE&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt; ACCEPT SOLUTION &lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 15:26:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/turn-of-the-visibility-of-a-solid-body-in-a-drawing-view-with/m-p/11733342#M148718</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-02-06T15:26:58Z</dc:date>
    </item>
  </channel>
</rss>

