《分数显示字段.doc》由会员分享,可在线阅读,更多相关《分数显示字段.doc(5页珍藏版)》请在金锄头文库上搜索。
1、1、设施点X,Y坐标用分数形式显示。解决方法:1)右键要显示设施的图层,选择open attribute table2)打开表以后,选择option 然后选择Add Field新建两个字段,分别命名为X 和 Y3)选中X字段,右键选择Calculate Geometry。给X字段赋值X坐标,给Y字段赋值Y坐标。4)右键该图层,选择Properties-选择label-选择expression。在Expression 中,选中Advanced 前面的对号,然后在空白区域输入表达式,Function FindLabel ( X , Y ) Dim nFMLength Dim nFZLength n
2、FMLength = Len(Y) nFZLength = Len(X) Dim strLeftSpace Dim strRightSpace strLeftSpace = strRightSpace= If nFMLength nFZLength Then For i=0 To (nFMLength-nFZLength)/2 strLeftSpace =strLeftSpace +chr(32) strRightSpace =strRightSpace + chr(32) Next End If FindLabel = &strLeftSpace &X &strRightSpace& &chr(13)&chr(10)& Y End Function点击确定,就可以了。这个表达式的作用就是让坐标X,Y通过分数形式显示。效果如下