Hi, everyone.
I'm using ArcGisPro, try to using 'calculate fields' tool.
I import following formula, "*.cal" file.
!P110003! / ((Sqr ( ( !x_coord! - !site1x!)^2 +( !y_coord! - !site1y!)^2 ))/5280)
Following error appears.
ERROR 000539: Traceback (most recent call last):
File "<expression>", line 1, in <module>
NameError: name 'Sqr' is not defined
*.cal file works well on ArcGis without an error.
How could I solve this problem?
Please help~! Thanks in advance.
Solved! Go to Solution.
^ should be **
!P110003! / ((math.sqrt((!x_coord!-!site1x!)**2 + (!y_coord!-!site1y!)**2)) / 5280)
Hi 윤서 양,
Change "Sqr" to "math.sqrt" like below and try one more time.
!P110003! / ((math.sqrt ( ( !x_coord! - !site1x!)^2 +( !y_coord! - !site1y!)^2 ))/5280)
Cheers,
Hamed
Thanks for your comment.
When I change "sqr" to "math.sqrt" as following.
!P110003! / ((math.sqrt((!x_coord!-!site1x!)^2+(!y_coord!-!site1y!)^2)) / 5280)
Other error appears as following.
Please help~! Thanks in advance!
^ should be **
!P110003! / ((math.sqrt((!x_coord!-!site1x!)**2 + (!y_coord!-!site1y!)**2)) / 5280)
It worked!!! Thank you Hamed Farzin and Dan Patterson!