I’m looking for a way to flip paths according to the selected point in the transformation-tool with a script. I found a script to flip, but it does only at the center of the selection.

Can I change any of these lines to flip at the bottom or at the right side?

I think, these are the essential code-lines for flipping:

*vertical:*

```
selectionYList = [ n.y for n in selection ]
lowestY, highestY = min( selectionYList ), max( selectionYList )
diffY = abs(lowestY-highestY)
midY = highestY - diffY/2
Font.disableUpdateInterface()
sortedSelection = sorted( selection, key=lambda n: n.y)
for thisNodeIndex in range( len(selection)):
sortedSelection[thisNodeIndex].y = sortedSelection[thisNodeIndex].y-(sortedSelection[thisNodeIndex].y-midY)*2
```

*horizontal*

```
selectionXList = [ n.x for n in selection ]
leftMostX, rightMostX = min( selectionXList ), max( selectionXList )
diffX = abs(rightMostX-leftMostX)
midX = rightMostX - diffX/2
Font.disableUpdateInterface()
sortedSelection = sorted( selection, key=lambda n: n.x)
for thisNodeIndex in range( len(selection)):
sortedSelection[thisNodeIndex].x = sortedSelection[thisNodeIndex].x-(sortedSelection[thisNodeIndex].x-midX)*2
```