Posts

Showing posts from August, 2015

Insert File/Layer Name Into Attribute Table ( The Power Of Phyton Part 5)

Hello,another phyton life saver incominggg the code im going to post below is very useful if you are going to insert the "file name" of your feature classess into attribute table (in certain field of course) Here goes # Import arcpy module import arcpy # Load required toolboxes arcpy.ImportToolbox("Model Functions") # Script arguments Wokspace = arcpy.GetParameterAsText(0) if Wokspace == '#' or not Wokspace: Wokspace = "E:\\Data\\Projects\\NWI\\Test_1" # provide a default value if unspecified Field_Name = arcpy.GetParameterAsText(1) if Field_Name == '#' or not Field_Name: Field_Name = "NAME" # provide a default value if unspecified Field_Type = arcpy.GetParameterAsText(2) if Field_Type == '#' or not Field_Type: Field_Type = "TEXT" # provide a default value if unspecified Field_Length = arcpy.GetParameterAsText(3) if Field_Length == '#' or not Field_Length: Field_Length = "