0

can anyone help me convert this vba script to python

```
On Error Resume Next
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pCurve As ICurve
Dim pFromPoint As IPoint
Dim dXFrom As Double
Dim bSrefFromMap As Boolean
'=======================
'Adjust the parameter below
'bSrefFromMap = True ==> the coordinates will be calculated in the projection of the Map
'bSrefFromMap = False ==> the coordinates will be calculated in the projection of the data
bSrefFromMap = False
'=======================
If (Not IsNull([Shape])) Then
Set pCurve = [Shape]
If (Not pCurve.IsEmpty) Then
If (bSrefFromMap) Then
Set pMxDoc = ThisDocument
Set pMap = pMxDoc.FocusMap
pCurve.Project pMap.SpatialReference
End If
Set pFromPoint = pCurve.FromPoint
dXFrom = pFromPoint.X
End If
End If
__esri_field_calculator_splitter__
dXFrom
```

thank you very much for the help

Edit: added code tags, vegaseat