<?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 body lines in drawing view by body name in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13174423#M174332</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I stumbled upon your code in this post, it does exactly what I wanted.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;A title="https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-all-other-solid-keep-selected-visibility-in-drawing-view/m-p/12129645#M155670 " href="https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-all-other-solid-keep-selected-visibility-in-drawing-view/m-p/12129645#M155670" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-all-other-solid-keep-selected-visibility-in-drawing-view/m-p/12129645#M155670 &lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I edited it a bit, the vba code is below for those who need it.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub Main()
    Dim oObj As Object
    Set oObj = ThisApplication.CommandManager.Pick(kDrawingViewFilter, "Select a Drawing View.")
    Dim oView As DrawingView
    Set oView = oObj
    Dim oModelDoc As Document
    Set oModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
    Dim oPDoc As PartDocument
    Set oPDoc = oModelDoc
    Dim oBodies As SurfaceBodies
    Set oBodies = oPDoc.ComponentDefinition.SurfaceBodies
    Dim oBodyNames As Collection
    Set oBodyNames = New Collection
    Dim oBody As SurfaceBody
    For Each oBody In oBodies
        oBodyNames.Add oBody.name
    Next
    Dim oBodyName As String
    oBodyName = InputBox("Body Names = ", "Input A Body Name", "P")
    If oBodyName = "" Then Exit Sub
    For Each oBody In oBodies
        If oBody.name &amp;lt;&amp;gt; oBodyName Then
            oView.SetVisibility oBody, False
        End If
    Next
    oView.Parent.Update 'update the sheet
    oView.Parent.Parent.Update ' update the drawing
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Tue, 26 Nov 2024 10:28:20 GMT</pubDate>
    <dc:creator>hieut1392</dc:creator>
    <dc:date>2024-11-26T10:28:20Z</dc:date>
    <item>
      <title>Hide body lines in drawing view by body name</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13165481#M174180</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I am new to macro.&lt;/SPAN&gt;&lt;/SPAN&gt; I&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; want to write a macro like title, it is difficult for me, can anyone help me?&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;1) Select desired view &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;2) Enter body name using input box for example &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;3) Hide all selected body lines&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Thanks you in advance.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 13:20:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13165481#M174180</guid>
      <dc:creator>hieut1392</dc:creator>
      <dc:date>2024-11-21T13:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Hide body lines in drawing view by body name</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13166301#M174193</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12726188"&gt;@hieut1392&lt;/a&gt;.&amp;nbsp; This is a relatively common request, but as usual, much more difficult to do by code than it is to do manually.&amp;nbsp; If you search within this forum, you will likely find several similar discussions very similar to this one.&amp;nbsp; Below is a link to another similar one I just replied to today:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-all-drawing-hidden-lines-that-aren-t-from-an-ifeature/m-p/13166022" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-all-drawing-hidden-lines-that-aren-t-from-an-ifeature/m-p/13166022&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is an example iLogic rule you can test with, to see if it works the way you want it to.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	Dim oInvApp As Inventor.Application = ThisApplication
	Dim oDDoc As DrawingDocument = TryCast(oInvApp.ActiveDocument, Inventor.DrawingDocument)
	If oDDoc Is Nothing Then Return
	Dim oView As DrawingView = oInvApp.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a Drawing View.")
	If oView Is Nothing Then Return
	Dim oViewDoc As Inventor.Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
	If (oViewDoc Is Nothing) OrElse (Not TypeOf oViewDoc Is PartDocument) Then Return
	Dim oViewPDoc As PartDocument = oViewDoc
	Dim oBodies As SurfaceBodies = oViewPDoc.ComponentDefinition.SurfaceBodies
	Dim oBodyNames As New List(Of String)
	For Each oBody As SurfaceBody In oBodies
		oBodyNames.Add(oBody.Name)
	Next
	Dim sSelectedBodyName As String = InputListBox("Pick Body Name", oBodyNames, "", "Body Names")
	If sSelectedBodyName Is Nothing OrElse sSelectedBodyName = "" Then Return
	Dim oSelectedBody As SurfaceBody = Nothing
	For Each oBody As SurfaceBody In oBodies
		If oBody.Name = sSelectedBodyName Then
			oSelectedBody = oBody
			Exit For
		End If
	Next
	If oSelectedBody Is Nothing Then Return
	Dim oObjColl As Inventor.ObjectCollection = oInvApp.TransientObjects.CreateObjectCollection
	Dim oDCurves As DrawingCurvesEnumerator = Nothing
	Try : oDCurves = oView.DrawingCurves(oSelectedBody) : Catch : End Try
	If oDCurves Is Nothing OrElse oDCurves.Count = 0 Then Return
	For Each oDCurve As DrawingCurve In oDCurves
		For Each oDCS As DrawingCurveSegment In oDCurve.Segments
			oObjColl.Add(oDCS)
		Next oDCS
	Next oDCurve
	Dim oTrans As Inventor.Transaction = oInvApp.TransactionManager.StartTransaction(oDDoc, "Hide Body Curves - iLogic")
	oDDoc.SelectSet.SelectMultiple(oObjColl)
	oInvApp.CommandManager.ControlDefinitions("DrawingEntityVisibilityCtxCmd").Execute
	oTrans.End
End Sub&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;</description>
      <pubDate>Thu, 21 Nov 2024 18:12:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13166301#M174193</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-11-21T18:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hide body lines in drawing view by body name</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13166347#M174194</link>
      <description>&lt;P&gt;Manually, you can look in the model browser tree of your drawing, expand the browser node of that specific view, then keep expanding child nodes until you can see the individual bodies.&amp;nbsp; Then right-click on the browser node for that body, and choose 'Select As Edges'.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_1-1732213143275.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1437047i2FE2EEB827A4251A/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_1-1732213143275.png" alt="WCrihfield_1-1732213143275.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then, all the lines (drawing curves) belonging to that body within that view will be selected.&amp;nbsp; Then right-click again somewhere out in the open area of your drawing sheet, and choose 'Visibility'.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_2-1732213273896.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1437048i4D56BF872E3CBB8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_2-1732213273896.png" alt="WCrihfield_2-1732213273896.png" /&gt;&lt;/span&gt;&amp;nbsp; Then boom, all those lines in the view are hidden.&amp;nbsp; And if you want them to show again, that is also fairly easy to do manually.&amp;nbsp; Just select the view in the sheet area, then right-click, and choose 'Show Hidden Edges'.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_3-1732213462487.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1437052iF4F7029021049343/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_3-1732213462487.png" alt="WCrihfield_3-1732213462487.png" /&gt;&lt;/span&gt;&amp;nbsp; Then, it will have those lines showing in red, and will be waiting for you to either choose which specific ones to show, or right-click again, and choose 'Show All'.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_4-1732213574755.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1437056i0A7BB208A55EEABD/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_4-1732213574755.png" alt="WCrihfield_4-1732213574755.png" /&gt;&lt;/span&gt;&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>Thu, 21 Nov 2024 18:26:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13166347#M174194</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-11-21T18:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hide body lines in drawing view by body name</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13167320#M174210</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;First of all, thank you for your help, I think I'm almost there, I'm just stuck at this point, I hope you can help me.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I found a code on the forum to hide the body by picking the edge of the body like this (code number 1) : &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oOccioV As DrawingCurveSegment
Set oOccioV = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick edge")

Dim oView As DrawingView
Set oView = oOccioV.Parent.Parent
    
Dim oToccoH As Object
Set oToccoH = oOccioV.Parent.ModelGeometry.Parent
    
Call oView.SetVisibility(oToccoH, False)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;However, the object is declared as Drawing Curve Segment.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; Your code runs perfectly ok, however, I want to hide the body like right-clicking on the body and selecting Visibility.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Is there a way to get the Drawing Curve Segment of a body whose name is known?&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I think I can combine your code and the code on the forum.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub Main
	Dim oInvApp As Inventor.Application = ThisApplication
	Dim oDDoc As DrawingDocument = TryCast(oInvApp.ActiveDocument, Inventor.DrawingDocument)
	If oDDoc Is Nothing Then Return
	Dim oView As DrawingView = oInvApp.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a Drawing View.")
	If oView Is Nothing Then Return
	Dim oViewDoc As Inventor.Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
	If (oViewDoc Is Nothing) OrElse (Not TypeOf oViewDoc Is PartDocument) Then Return
	Dim oViewPDoc As PartDocument = oViewDoc
	Dim oBodies As SurfaceBodies = oViewPDoc.ComponentDefinition.SurfaceBodies
	Dim oBodyNames As New List(Of String)
	For Each oBody As SurfaceBody In oBodies
		oBodyNames.Add(oBody.Name)
	Next
	Dim sSelectedBodyName As String = InputListBox("Pick Body Name", oBodyNames, "", "Body Names")
	If sSelectedBodyName Is Nothing OrElse sSelectedBodyName = "" Then Return
	Dim oSelectedBody As SurfaceBody = Nothing
	For Each oBody As SurfaceBody In oBodies
		If oBody.Name = sSelectedBodyName Then
			oSelectedBody = oBody
			Exit For
		End If
	Next
	If oSelectedBody Is Nothing Then Return
'CODE NUMBER 1 HERE

End Sub&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 05:59:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13167320#M174210</guid>
      <dc:creator>hieut1392</dc:creator>
      <dc:date>2024-11-22T05:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hide body lines in drawing view by body name</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13168289#M174246</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12726188"&gt;@hieut1392&lt;/a&gt;.&amp;nbsp; That is a nice thought, but I don't think it will be practical.&amp;nbsp; That&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DrawingView_SetVisibility" target="_blank" rel="noopener"&gt;DrawingView.SetVisibility&lt;/A&gt;&amp;nbsp;method can only work on one entity at a time, and a &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-SurfaceBody" target="_blank" rel="noopener"&gt;SurfaceBody&lt;/A&gt; object does not appear to be one of the objects that we can provide to that method directly.&amp;nbsp; (I did do some testing to make sure.)&amp;nbsp; One of the most challenging points in a code like that first one, is where it encounters the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DrawingCurve_ModelGeometry" target="_blank" rel="noopener"&gt;DrawingCurve.ModelGeometry&lt;/A&gt;&amp;nbsp;property, because its value is just a generic Object type.&amp;nbsp; That property has that type of value because it can return many different types of objects, depending on what type of document was directly referenced in the view, and what that specific piece of view geometry was based on.&amp;nbsp; It could be sketch geometry, or work feature, assembly component geometry, assembly proxy stuff, curved outer surface profile/silhouette, etc.&amp;nbsp; Likely the most common thing to expect, when the view is of a part, is an Edge object.&amp;nbsp; If that is the case, then its 'parent' will be a SurfaceBody object.&amp;nbsp; So, if you want to 'pick' the edge of the body, instead of specify the body by its name, then that part would be possible.&amp;nbsp; But the part of the code where we turn the visibility of all the geometry in the view belonging to that body, is another story, and there are just a few options that I have ever seen.&amp;nbsp; Setting each &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DrawingCurveSegment_Visible" target="_blank" rel="noopener"&gt;DrawingCurveSegment.Visible&lt;/A&gt; property to False (takes a long time), gathering them all into an ObjectCollection, then either select them and execute the command on them, or use the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Sheet_ChangeLayer" target="_blank" rel="noopener"&gt;Sheet.ChangeLayer&lt;/A&gt;&amp;nbsp;method on them.&amp;nbsp; When doing the ChangeLayer route, we can create a new custom layer, then set its visibility to False, then set that geometry to that Layer.&amp;nbsp; It's not the easiest to undo later though if needed, if you have done other things after that happened.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, we can not really modify the right-click menu to include additional functionality, without some serious complication, such as an Inventor add-in, because it involves customizing Inventor's user interface, and monitoring the 'events' of those custom things we add into it with our own event handlers, to support their functionality with our own code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you considered:&amp;nbsp; Create a custom DVR (DesignViewRepresentation) in the part, make sure it is 'active', then turn off the visibility of that body, so that DVR will record it, then save the part file.&amp;nbsp; Then in the drawing of that part, set the view of that part to that DVR.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 14:55:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13168289#M174246</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-11-22T14:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Hide body lines in drawing view by body name</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13174423#M174332</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I stumbled upon your code in this post, it does exactly what I wanted.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;A title="https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-all-other-solid-keep-selected-visibility-in-drawing-view/m-p/12129645#M155670 " href="https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-all-other-solid-keep-selected-visibility-in-drawing-view/m-p/12129645#M155670" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-all-other-solid-keep-selected-visibility-in-drawing-view/m-p/12129645#M155670 &lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I edited it a bit, the vba code is below for those who need it.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub Main()
    Dim oObj As Object
    Set oObj = ThisApplication.CommandManager.Pick(kDrawingViewFilter, "Select a Drawing View.")
    Dim oView As DrawingView
    Set oView = oObj
    Dim oModelDoc As Document
    Set oModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
    Dim oPDoc As PartDocument
    Set oPDoc = oModelDoc
    Dim oBodies As SurfaceBodies
    Set oBodies = oPDoc.ComponentDefinition.SurfaceBodies
    Dim oBodyNames As Collection
    Set oBodyNames = New Collection
    Dim oBody As SurfaceBody
    For Each oBody In oBodies
        oBodyNames.Add oBody.name
    Next
    Dim oBodyName As String
    oBodyName = InputBox("Body Names = ", "Input A Body Name", "P")
    If oBodyName = "" Then Exit Sub
    For Each oBody In oBodies
        If oBody.name &amp;lt;&amp;gt; oBodyName Then
            oView.SetVisibility oBody, False
        End If
    Next
    oView.Parent.Update 'update the sheet
    oView.Parent.Parent.Update ' update the drawing
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 26 Nov 2024 10:28:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/hide-body-lines-in-drawing-view-by-body-name/m-p/13174423#M174332</guid>
      <dc:creator>hieut1392</dc:creator>
      <dc:date>2024-11-26T10:28:20Z</dc:date>
    </item>
  </channel>
</rss>

