11-27-2021
08:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-27-2021
08:25 AM
Maybe this is what you need:
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) Dim segments = doc.Sheets.Cast(Of Sheet). SelectMany(Function(sheet) sheet.DrawingViews.Cast(Of DrawingView)). SelectMany(Function(view) view.DrawingCurves.Cast(Of DrawingCurve)). Where(Function(curve) curve.EdgeType = EdgeType). SelectMany(Function(curve) curve.Segments.Cast(Of DrawingCurveSegment)). ToList() For Each segment As DrawingCurveSegment In segments segment.Layer = layer Next End Sub
Edit:
improved the rule
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