<?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: Layer Visibility On Different Sheets in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296481#M130309</link>
    <description>&lt;P&gt;I usually do it that way too but we like to have a separate sheet that shows the&amp;nbsp;flat&amp;nbsp;view exactly as you would see it in the DXF.&amp;nbsp; Right now we just right click on them and turn off.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2013 15:16:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-06-12T15:16:49Z</dc:date>
    <item>
      <title>Layer Visibility On Different Sheets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296209#M130305</link>
      <description>&lt;P&gt;I am trying to control the layer visibility on different sheets of the same drawing but have not quite figured it out yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We add a DXF sheet to drawings with flat pattern views to export to DXF for our laser.&amp;nbsp; I wrote a VBA macro that adds the sheet, copies the flat pattern view and removes the dimensions to clean it up before creating the DXF.&amp;nbsp; I am having a problem&amp;nbsp;turning off the visibility of&amp;nbsp;the bend lines on JUST the DXF sheet.&amp;nbsp; I can turn bend lines and hidden lines&amp;nbsp;off with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'Turn off bend lines and hidden lines
For Each oView In oSheet.DrawingViews

    'Set the layers collection
    Set oLayers = oDrawingDoc.StylesManager.Layers
    
    'Turn off all bend lines and hidden lines
    For Each oLayer In oLayers
        If Not InStr(oLayer.Name, "Bend Centerline") = 0 Or Not InStr(oLayer.Name, "Hidden") = 0 Then
            oLayer.Visible = False
        Else
        End If
    Next
    
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;but it turns them off on all sheets.&amp;nbsp; I want to only turn them off on the DXF sheet.&amp;nbsp; How would this be done?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 12:27:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296209#M130305</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-12T12:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Visibility On Different Sheets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296292#M130306</link>
      <description>&lt;P&gt;Here's how I usually turn off hidden for a specific sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub TurnOffHidden()
Dim oDrawingDoc As DrawingDocument
Set oDrawingDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
'Define which sheet
Set oSheet = oDrawingDoc.Sheets.Item(1)

Dim oView As DrawingView
    For Each oView In oSheet.DrawingViews
        oView.ViewStyle = kHiddenLineRemovedDrawingViewStyle
    Next
End Sub&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2013 13:32:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296292#M130306</guid>
      <dc:creator>jdkriek</dc:creator>
      <dc:date>2013-06-12T13:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Visibility On Different Sheets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296296#M130307</link>
      <description>&lt;P&gt;Thanks, that is half the problem.&amp;nbsp; Any ideas for the bend lines?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 13:36:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296296#M130307</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-12T13:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Visibility On Different Sheets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296388#M130308</link>
      <description>&lt;P&gt;I usually set those options when I export the DXF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oDataIO As DataIO
Set oDataIO = oPart.ComponentDefinition.DataIO
        
'Set ACAD Version, Outer Profile, and hide bend lines
Dim sOut As String
sOut = "FLAT PATTERN DXF?AcadVersion=2000&amp;amp;OuterProfileLayer=Outer&amp;amp;InvisibleLayers=IV_Tangent;IV_Bend;IV_Bend_Down;IV_Bend_Up;IV_ARC_CENTERS"
        
'Create Save Path
Dim SavePath As String
SavePath = "C:\DXF OUT\" &amp;amp; sPartNum.Value &amp;amp; ".dxf"

'Create the DXF file.
oDataIO.WriteDataToFile sOut, SavePath&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2013 14:33:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296388#M130308</guid>
      <dc:creator>jdkriek</dc:creator>
      <dc:date>2013-06-12T14:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Visibility On Different Sheets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296481#M130309</link>
      <description>&lt;P&gt;I usually do it that way too but we like to have a separate sheet that shows the&amp;nbsp;flat&amp;nbsp;view exactly as you would see it in the DXF.&amp;nbsp; Right now we just right click on them and turn off.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 15:16:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296481#M130309</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-12T15:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Visibility On Different Sheets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296608#M130310</link>
      <description>&lt;P&gt;This is as far as I got.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's interesting to me that once I found the bendline, I wasn't able to select it for&amp;nbsp;DrawingEntityVisibilityCtxCmd via the Command Manager which is the command that is used when you right-click and hide the line through the UI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub NixHiddenBend()
Dim oDrawingDoc As DrawingDocument
Set oDrawingDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
'Define which sheet
Set oSheet = oDrawingDoc.Sheets.Item(1)
Dim oView As DrawingView
    For Each oView In oSheet.DrawingViews
        oView.ViewStyle = kHiddenLineRemovedDrawingViewStyle
        'If it's a flatpattern view
        If oView.IsFlatPatternView = True Then
            Dim oViewCurves As DrawingCurvesEnumerator
            Set oViewCurves = oView.DrawingCurves()
            Dim oBendLine As DrawingCurve
                'Find all the lines
                For count = 1 To oViewCurves.count
                    Set oBendLine = oViewCurves.Item(count)
                    'If it's a bendline
                    If oBendLine.EdgeType = kBendDownEdge Or oBendLine.EdgeType = kBendUpEdge Then
                        MsgBox ("Found you pesky bendline")
                    End If
                Next
        End If
    Next
End Sub&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2013 16:38:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4296608#M130310</guid>
      <dc:creator>jdkriek</dc:creator>
      <dc:date>2013-06-12T16:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Layer Visibility On Different Sheets</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4308280#M130311</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A id="link_13f7a2de649" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/341185" target="_self"&gt;jdkriek&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;I just took a look at the issue "&lt;EM&gt;wasn't able to select it for&amp;nbsp;DrawingEntityVisibilityCtxCmd&lt;/EM&gt;". After I modified the code as below, it works.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;Sub NixHiddenBend()
Dim oDrawingDoc As DrawingDocument
Set oDrawingDoc = ThisApplication.ActiveDocument

&lt;STRONG&gt;Dim oSel As SelectSet
Set oSel = oDrawingDoc.SelectSet
oSel.Clear&lt;/STRONG&gt;

Dim oSheet As Sheet
'Define which sheet
Set oSheet = oDrawingDoc.Sheets.Item(1)
Dim oView As DrawingView
    For Each oView In oSheet.DrawingViews
        oView.ViewStyle = kHiddenLineRemovedDrawingViewStyle
        'If it's a flatpattern view
        If oView.IsFlatPatternView = True Then
            Dim oViewCurves As DrawingCurvesEnumerator
            Set oViewCurves = oView.DrawingCurves()
            Dim oBendLine As DrawingCurve
                'Find all the lines
                For Count = 1 To oViewCurves.Count
                    Set oBendLine = oViewCurves.Item(Count)
                    'If it's a bendline
                    If oBendLine.EdgeType = kBendDownEdge Or oBendLine.EdgeType = kBendUpEdge Then
                        'MsgBox ("Found you pesky bendline")
                      &lt;STRONG&gt;  Dim oSeg As DrawingCurveSegment
                        For Each oSeg In oBendLine.Segments
                            oSel.Select oSeg
                        Next&lt;/STRONG&gt;
                    End If
                Next
        End If
    Next
    
    
&lt;STRONG&gt;     ThisApplication.CommandManager.ControlDefinitions("DrawingEntityVisibilityCtxCmd").Execute
&lt;/STRONG&gt;End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 07:27:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/layer-visibility-on-different-sheets/m-p/4308280#M130311</guid>
      <dc:creator>xiaodong_liang</dc:creator>
      <dc:date>2013-06-25T07:27:57Z</dc:date>
    </item>
  </channel>
</rss>

