12-04-2021
06:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-04-2021
06:04 AM
In the code, I use the LINQ library. I'm not sure if that library is already available in Inventor 2017. This is the same rule only without the helper functions from the LINQ library.
Sub Main() Dim doc As DrawingDocument = ThisDoc.Document ChangeLayer(doc, DrawingEdgeTypeEnum.kBendUpEdge, "ARRIBA") ChangeLayer(doc, DrawingEdgeTypeEnum.kBendDownEdge, "ABAJO") End Sub Private Sub ChangeLayer(doc As DrawingDocument, EdgeType As DrawingEdgeTypeEnum, layerName As String) Dim layer As Layer = doc.StylesManager.Layers.Item(layerName) For Each sheet As Sheet In doc.Sheets For Each view As DrawingView In Sheet.DrawingViews For Each curve As DrawingCurve In View.DrawingCurves If (curve.EdgeType = EdgeType) Then For Each segment As DrawingCurveSegment In curve.Segments segment.Layer = layer Next End If Next Next Next End Sub
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com