Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with vba to python

Status
Not open for further replies.

abell1234

Technical User
Jan 4, 2006
1
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top