POST
|
Dear Sir! I tried to customize a field value in polygon featureclass. For that I wrote a python function. Then using Field Calculator, I copy this function to Pre_Logic Script Code: and call the function. it gives me error. Then I tried the same using Calculate Field tool in ArcToolbox. It works correctly. Pl explain why I cannot run the above function using Field Calculator. My function is given below: def lblcal(a): Dic1 = {'11':'PP', '13':'TOPOPP', '14':'FTP', '15':'VP', '16':'FVP', '17':'CP', '18':'FCP', '19':'FSP', '20':'FSPP', '21':'ISPP', '22':'FUP'} if a[2:4] in Dic1.keys(): m = Dic1.get(a[2:4]) if (a[9] == 's') is True: str1 = 'SUP' + str(int(a[10:15])) else: str1 = 'Inset' + str(int(a[10:15])) if (a[15] == 's') is True: str2 = 'Sheet' + str(int(a[16:20])) str3 = m + ' ' + str(int(a[4:9])) + str1 + str2 return (str3) I am working in ArcGIS 9.3 Thanks Padmasiri
... View more
07-13-2015
03:09 AM
|
0
|
2
|
2898
|
POST
|
Dear Sir When I move the mouse pointer to relevent object(point,line or polygon). Can I display it's selected attribute data as a tag.(like tool tip) Thanks hadpadmasiri
... View more
06-05-2015
01:22 AM
|
0
|
1
|
3064
|
POST
|
Dear sir! When I use unicode "SINHALA" (Our local fonts) in Python, It gives me following message >>> str1 = "මාතා" Unsupported characters in input How to solve this Problem Thanks Padmasiri
... View more
04-21-2015
03:49 AM
|
0
|
1
|
2558
|
POST
|
Dear Sir I am new to ArcGIS Explorer. For experiment, first I create a new featureclass with a help of select tool in Analysis Tools. After that I publish that tool using results window as a geoprocessing service. Then I add to that tool to ArcGIS Explorer using add from URL in Analysis. It run without an error, output featureclass is created, but empty. Can you explain what wrong with my procedure. Thanks Padmasiri
... View more
02-22-2015
09:05 PM
|
0
|
0
|
3691
|
POST
|
Dear Sir I am new to ArcGIS explorer. In ArcGIS explorer window, I tried to run a tool through geoprocessing service. It run without an error. Final output is a featureclass. But featureclass is empty. Can you explain what's wrong with my procedure. Thanks Padmasiri
... View more
02-10-2015
12:44 AM
|
0
|
0
|
3582
|
POST
|
dear sir! I wrote a python function to replace an attribute. But variable "a & b" not passing through CalculateField_management. Can you give me an advice to correct it. Thanks Padmasiri def foo(s1): return "'{}'".format(s1) def BoundCal(a,b): New_Name = arcpy.AddFieldDelimiters(env.workspace, "PCL_LN_CD") where1 = New_Name + '=' + foo(str(a)) arcpy.SelectLayerByAttribute_management("ABC_Lyr", "NEW_SELECTION", where1) arcpy.CalculateField_management("ABC_Lyr", "PCL_LN_CD", "!PCL_LN_CD!.replace(\"a\", \"b\")" , "PYTHON_9.3" "")
... View more
11-27-2014
08:51 PM
|
0
|
1
|
2675
|
POST
|
Dear sir I want to format a string as \"mystring\". how to do this. Thanks Padmasiri
... View more
11-19-2014
01:16 AM
|
0
|
1
|
1325
|
POST
|
Dear sir String = "BLVF" I want to format string to \"BLVF\". I tried it like "\'{}\'".format(String) It gives me wrong answer. pl give me a help to format this Thanks Padmasiri
... View more
11-18-2014
10:40 PM
|
0
|
3
|
1766
|
POST
|
Dear Sir! I tried to write a python script to display labels, and export to pdf. But in pdf the labels are not display. My script is given below. Pl give me a advice to correct it. import arcpy from arcpy import mapping mxd = arcpy.mapping.MapDocument(r"J:\Gampaha\51027202\ASD.mxd") df = arcpy.mapping.ListDataFrames(mxd, "*")[0] LayerFile = arcpy.mapping.Layer(r"J:\Gampaha\51027202\LIS.lyr") arcpy.mapping.AddLayer(df, LayerFile, "AUTO_ARRANGE") df.zoomToSelectedFeatures() ExistLayer = arcpy.mapping.ListLayers(mxd, "*", df) if ExistLayer[0].supports("LABELCLASSES"): List1 = ExistLayer[0].labelClasses List1[0].className = "Parcelid" List1[0].expression = "[Parcelid]" List1[0].showClassLabels = True mxd.saveACopy(r"J:\Gampaha\51027202\Pro.mxd") arcpy.mapping.ExportToPDF(mxd, r"J:\Gampaha\51027202\Pro.pdf") del mxd Thanks Padmasiri
... View more
11-12-2014
02:49 AM
|
0
|
1
|
1258
|
POST
|
Dear Sir Thanks to reply me. I can understand what you said. In generally .lyr file cannot save within a geodatabase. it can be save in a folder. Then I tried this way. import arcpy from arcpy import env env.workspace = r"J:\Gampaha\51027202\CM51027202.gdb\CM51027202" workspace = os.path.dirname(env.workspace) arcpy.MakeFeatureLayer_management("PCL_PG", "ASD", "", workspace) arcpy.SaveToLayerFile_management("ASD", "AMD.lyr", "ABSOLUTE") Same error occurred. Thanks Padmasiri
... View more
10-16-2014
06:15 AM
|
0
|
0
|
229
|
POST
|
Dear sir! When I tried to create a .lyr file, The following error message come. I cant understand what's wrong with my script. Please help me to solve it. import arcpy from arcpy import env env.workspace = r"J:\Gampaha\51027202\CM51027202.gdb\CM51027202" arcpy.MakeFeatureLayer_management("PCL_PG", "ASD") arcpy.SaveToLayerFile_management("ASD", "AMD.lyr", "ABSOLUTE") Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> arcpy.SaveToLayerFile_management("ASD", "AMD.lyr", "ABSOLUTE") File "C:\Program Files\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 6640, in SaveToLayerFile raise e ExecuteError: ERROR 999999: Error executing function. Failed to execute (SaveToLayerFile). Thanks Padmasiri
... View more
10-14-2014
02:40 AM
|
0
|
2
|
2991
|
POST
|
dear sir a ="BOUND-B-GEN" env.workspace = r"E:\Gampaha\51027202\CM51027202.gdb\CM51027202" newName = arcpy.AddFieldDelimiters(env.workspace, "PCL_LN_DL") I want to format following style "PCL_LN_DL" = 'BOUND-B-GEN' I tried to format following way where = newName + '=' + '{0}{1}{2}'.format ('\'',str(a),'\'') But it gives me wrong result, how to add single quote around BOUND-B-GEN pl help me. Thanks Padmasiri
... View more
09-17-2014
07:58 PM
|
0
|
1
|
2917
|
POST
|
Dear Sir I wrote a python script to do some processing. Finally I want to write something as a report in windows sticky notes. I can write it to notepad But I have no idea to write in sticky notes. is it possible ?. Can you please give me an advice to do this. Thanks Padmasiri
... View more
08-12-2014
01:02 AM
|
0
|
0
|
2524
|
POST
|
Dear Sir Can you pl explain how to manage Following type of mark (See attachment) in geodatabase that draw in AutoCAD drawing Thanks Padmasiri
... View more
05-15-2014
10:07 PM
|
0
|
0
|
315
|
POST
|
Hello Padmasiri, Thank seems strange. One suggestion, are you starting your list at 0? As in arcpy.GetParameterAsText(0) is the first text input and arcpy.GetParameterAsText(4) would be the fifth. Alternatively you can try using sys.argv[]. It would look something like this: import sys
input1=sys.argv[1] #Note that the list starts at 1 because sys.argv[0] stores the location of the current script.
input2=sys.argv[2]
input3=sys.argv[3]
input4=sys.argv[4]
input5=sys.argv[5] #the fifth input to the tool. Same as arcpy.GetParameterAsText(4) Good luck! Dear sir Thank you very much for your answer. It run correctly when I amend according to you. Thanks again Padmasiri
... View more
05-12-2014
12:02 AM
|
0
|
0
|
1266
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|