how to change direction of multiple lines simultaneously?

I have multiple  lines , how can I change direction of all of them at once? Right now I'm using utilities-key-in-change direction, it's a hectic task when there are many lines. Thanks!!

Parents
  • Hi Tatyana,

    I think it cannot be done manually, because you mentioned also, the direction arrow has to be clicked by mouse.

    But it can be done using simple VBA macro:

    Public Sub ChangeLineDirection()
    
        Dim esc As New ElementScanCriteria
        esc.ExcludeAllTypes
        esc.IncludeType msdElementTypeLine
        esc.IncludeType msdElementTypeLineString
        
        Dim ee As ElementEnumerator
        Set ee = ActiveModelReference.Scan(esc)
        
        Do While ee.MoveNext
            Dim line As LineElement
            Set line = ee.Current.AsLineElement
            
            line.Reverse
            line.Rewrite
        Loop
    
    End Sub

    With regards,

      Jan

Reply
  • Hi Tatyana,

    I think it cannot be done manually, because you mentioned also, the direction arrow has to be clicked by mouse.

    But it can be done using simple VBA macro:

    Public Sub ChangeLineDirection()
    
        Dim esc As New ElementScanCriteria
        esc.ExcludeAllTypes
        esc.IncludeType msdElementTypeLine
        esc.IncludeType msdElementTypeLineString
        
        Dim ee As ElementEnumerator
        Set ee = ActiveModelReference.Scan(esc)
        
        Do While ee.MoveNext
            Dim line As LineElement
            Set line = ee.Current.AsLineElement
            
            line.Reverse
            line.Rewrite
        Loop
    
    End Sub

    With regards,

      Jan

Children
No Data