I am new to programming and I was wondering if anyone could help me with converting 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
it is for my work and I dont have the time to learn python today, however in the future I intend to get a grip on python. Thank you for your help
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
it is for my work and I dont have the time to learn python today, however in the future I intend to get a grip on python. Thank you for your help