Select to view content in your preferred language

Syntax Error at the End of My Script After the arguments

933
2
07-24-2012 06:20 PM
NickJones
Emerging Contributor
Nevermind!!!!
Tags (2)
0 Kudos
2 Replies
NickJones
Emerging Contributor
# Process: Create TIN
arcpy.CreateTin_3d(InvertTIN, "PROJCS['NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',2296583.333333333],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-84.16666666666667],PARAMETER['Scale_Factor',0.9999],PARAMETER['Latitude_Of_Origin',30.0],UNIT['Foot_US',0.3048006096012192]],VERTCS['NAVD_1988',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Foot_US',0.3048006096012192]]", "UpstreamPerpLineLeft US_INV_ELV softline <None>;UpstreamPerpLineRight US_INV_ELV softline <None>;DownstreamPerpLineLeft DS_INV_ELV softline <None>;DownstreamPerpLineRight DS_INV_ELV softline <None>", "DELAUNAY")

# Process: Densify
arcpy.Densify_edit(ClosedConduits, "DISTANCE", "1 Feet", "0.33 Feet", "10")

# Process: Feature Vertices To Points
arcpy.FeatureVerticesToPoints_management(ClosedConduits, ClosedConduitsVertexPoints, "ALL")

# Process: Add XY Coordinates
arcpy.AddXY_management(ClosedConduitsVertexPoints)

# Process: Add Surface Information
arcpy.AddSurfaceInformation_3d(ClosedConduitsVertexPoints, InvertTIN, "Z", "LINEAR", "", "1", "0")

# Process: Add Field (3)
arcpy.AddField_management(ClosedConduitsVertexPoints, "Invert", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field (3)
arcpy.CalculateField_management(ClosedConduitsVertexPoints, "Invert", "", "VB", "")

# Process: Delete Field
arcpy.DeleteField_management(ClosedConduitsVertexPoints, "Z")

# Process: Add Surface Information (2)
arcpy.AddSurfaceInformation_3d(ClosedConduitsVertexPoints, Topography_Terrain, "Z", "LINEAR", "", "1", "0")

# Process: Add Field (4)
arcpy.AddField_management(ClosedConduitsVertexPoints, "GrElev", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field (4)
arcpy.CalculateField_management(ClosedConduitsVertexPoints, "GrElev", "", "VB", "")

# Process: Delete Field (2)
arcpy.DeleteField_management(ClosedConduitsVertexPoints, "Z")

# Process: Add Field (5)
arcpy.AddField_management(ClosedConduitsVertexPoints, "Depth", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field (5)
arcpy.CalculateField_management(ClosedConduitsVertexPoints, "Depth", "[GrElev] - [Invert]", "VB", "")

# Process: Add Field (6)
arcpy.AddField_management(ClosedConduitsVertexPoints, "TrenchB", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field (6)
arcpy.CalculateField_management(ClosedConduitsVertexPoints, "TrenchB", "( [SPAN]/2)+3", "VB", "")

# Process: Add Field (7)
arcpy.AddField_management(ClosedConduitsVertexPoints, "TrenchT", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field (7)
arcpy.CalculateField_management(ClosedConduitsVertexPoints, "TrenchT", "[TrenchB] + [Depth]", "VB", "")

# Process: Bearing Distance To Line (3)
arcpy.BearingDistanceToLine_management(ClosedConduitsVertexPoints, TrenchTopRightLine, "POINT_X", "POINT_Y", "TrenchT", "METERS", "RAR", "DEGREES", "GEODESIC", "FacID_Text", "PROJCS['NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',2296583.333333333],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-84.16666666666667],PARAMETER['Scale_Factor',0.9999],PARAMETER['Latitude_Of_Origin',30.0],UNIT['Foot_US',0.3048006096012192]],VERTCS['NAVD_1988',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Foot_US',0.3048006096012192]];-16150100 -43703500 137255279.033962;-100000 3048.00609601219;-100000 10000;3.28083333333333E-03;3.28083333333333E-03;0.001;IsHighPrecision")

# Process: Feature Vertices To Points (6)
arcpy.FeatureVerticesToPoints_management(TrenchTopRightLine, TrenchTopRightPts, "END")

# Process: Add Surface Information (3)
arcpy.AddSurfaceInformation_3d(TrenchTopRightPts, Topography_Terrain, "Z", "LINEAR", "", "1", "0")

# Process: Add Field (8)
arcpy.AddField_management(TrenchTopRightPt_shp__2_, "GrElev2", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field (8)
arcpy.CalculateField_management(TrenchTopRightPts, "GrElev2", "", "VB", "")

# Process: Delete Field (3)
arcpy.DeleteField_management(TrenchTopRightPts, "Z")

# Process: Bearing Distance To Line (4)
arcpy.BearingDistanceToLine_management(ClosedConduitsVertexPoints, TrenchTopLeftLine, "POINT_X", "POINT_Y", "TrenchT", "METERS", "RAL", "DEGREES", "GEODESIC", "FacID_Text", "PROJCS['NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',2296583.333333333],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-84.16666666666667],PARAMETER['Scale_Factor',0.9999],PARAMETER['Latitude_Of_Origin',30.0],UNIT['Foot_US',0.3048006096012192]],VERTCS['NAVD_1988',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Foot_US',0.3048006096012192]];-16150100 -43703500 137255279.033962;-100000 3048.00609601219;-100000 10000;3.28083333333333E-03;3.28083333333333E-03;0.001;IsHighPrecision")

# Process: Feature Vertices To Points (7)
arcpy.FeatureVerticesToPoints_management(TrenchTopLeftLine, TrenchTopLeftPts, "END")

# Process: Add Surface Information (4)
arcpy.AddSurfaceInformation_3d(TrenchTopLeftPts, Topography_Terrain, "Z", "LINEAR", "", "1", "0")

# Process: Add Field (9)
arcpy.AddField_management(TrenchTopLeftPts, "GrElev2", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field (9)
arcpy.CalculateField_management(TrenchTopLeftPts, "GrElev2", "", "VB", "")

# Process: Delete Field (4)
arcpy.DeleteField_management(TrenchTopLeftPts, "Z")

# Process: Bearing Distance To Line
arcpy.BearingDistanceToLine_management(ClosedConduitsVertexPoints, TrenchBottomRightLine, "POINT_X", "POINT_Y", "TrenchB", "METERS", "RAR", "DEGREES", "GEODESIC", "FacID_Text", "PROJCS['NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',2296583.333333333],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-84.16666666666667],PARAMETER['Scale_Factor',0.9999],PARAMETER['Latitude_Of_Origin',30.0],UNIT['Foot_US',0.3048006096012192]],VERTCS['NAVD_1988',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Foot_US',0.3048006096012192]];-16150100 -43703500 137255279.033962;-100000 3048.00609601219;-100000 10000;3.28083333333333E-03;3.28083333333333E-03;0.001;IsHighPrecision")

# Process: Feature Vertices To Points (4)
arcpy.FeatureVerticesToPoints_management(TrenchBottomRightLine, TrenchBottomRightPt, "END")

# Process: Join Field
arcpy.JoinField_management(TrenchBottomRightPt, "POINT_Y", ClosedConduitsVertexPoints, "POINT_Y", "Invert")

# Process: Bearing Distance To Line (2)
arcpy.BearingDistanceToLine_management(ClosedConduitsVertexPoints, TrenchBottomLeftLine, "POINT_X", "POINT_Y", "TrenchB", "METERS", "RAL", "DEGREES", "GEODESIC", "FacID_Text", "PROJCS['NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',2296583.333333333],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-84.16666666666667],PARAMETER['Scale_Factor',0.9999],PARAMETER['Latitude_Of_Origin',30.0],UNIT['Foot_US',0.3048006096012192]],VERTCS['NAVD_1988',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Foot_US',0.3048006096012192]];-16150100 -43703500 137255279.033962;-100000 3048.00609601219;-100000 10000;3.28083333333333E-03;3.28083333333333E-03;0.001;IsHighPrecision")
0 Kudos
NickJones
Emerging Contributor
# Process: Feature Vertices To Points (5)
arcpy.FeatureVerticesToPoints_management(TrenchBottomLeftLine, TrenchBottomLeftPt, "END")

# Process: Join Field (2)
arcpy.JoinField_management(TrenchBottomLeftPt, "POINT_Y", ClosedConduitsVertexPoints, "POINT_Y", "Invert")
# Process: Points To Line (3)
arcpy.gp.toolbox = "C:/GIS/Temp/ConduitsScripts.tbx";
# Warning: the toolbox C:/GIS/Temp/ConduitsScripts.tbx DOES NOT have an alias.
# Please assign this toolbox an alias to avoid tool name collisions
# And replace arcpy.gp.PointsToLine(...) with arcpy.PointsToLine_ALIAS(...)
arcpy.gp.PointsToLine(TrenchTopLeftPts, TrenchTopLeftBoundaryLine, "FacID_Text", "OID", "NO_CLOSE")

# Process: Points To Line
arcpy.gp.toolbox = "C:/GIS/Temp/ConduitsScripts.tbx";
# Warning: the toolbox C:/GIS/Temp/ConduitsScripts.tbx DOES NOT have an alias.
# Please assign this toolbox an alias to avoid tool name collisions
# And replace arcpy.gp.PointsToLine(...) with arcpy.PointsToLine_ALIAS(...)
arcpy.gp.PointsToLine(TrenchTopRightPts, TrenchTopRightBoundaryLine, "FacID_Text", "OID", "NO_CLOSE")

# Process: Merge
arcpy.Merge_management("DownstreamPerpLineRight;DownstreamPerpLineLeft;UpstreamPerpLineRight;UpstreamPerpLineLeft;TrenchTopLeftBoundaryLine;TrenchTopRightBoundaryLine",TrenchBoundaryLines,"#")

# Process: Feature To Polygon
arcpy.FeatureToPolygon_management(TrenchBoundaryLines, TrenchBoundaryPolygons, "", "NO_ATTRIBUTES", "")

# Process: Create TIN (2)
arcpy.CreateTin_3d(TrenchTIN, "PROJCS['NAD_1983_StatePlane_Georgia_West_FIPS_1002_Feet',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',2296583.333333333],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-84.16666666666667],PARAMETER['Scale_Factor',0.9999],PARAMETER['Latitude_Of_Origin',30.0],UNIT['Foot_US',0.3048006096012192]],VERTCS['NAVD_1988',VDATUM['North_American_Vertical_Datum_1988'],PARAMETER['Vertical_Shift',0.0],PARAMETER['Direction',1.0],UNIT['Foot_US',0.3048006096012192]]", "TrenchTopRightPts GrElev2 masspoints <None>;TrenchTopLeftPts GrElev2 masspoints <None>;ClosedConduitsVertexPoints Invert masspoints <None>;TrenchBottomRightPt Invert masspoints <None>;TrenchBottomLeftPt Invert masspoints <None>;TrenchBoundaryPolygons <None> softclip <None>", "DELAUNAY")

# Process: Surface Difference
arcpy.SurfaceDifference_3d(TrenchTIN, Topography_Terrain, SurfaceDifference, "0", "0", Output_Raster, "10", "", "")

# Process: Spatial Join
arcpy.SpatialJoin_analysis(TrenchBoundaryPolygons, ClosedConduits, TrenchBoundaryJoinedToConduit, "JOIN_ONE_TO_ONE", "KEEP_ALL", "Shape_leng \"Shape_leng\" true true false 0 Double 0 0 ,First,#,in_memory\\TrenchBoundaryPolygons,Shape_length,-1,-1;Shape_area \"Shape_area\" true true false 0 Double 0 0 ,First,#,in_memory\\TrenchBoundaryPolygons,Shape_area,-1,-1;Id \"Id\" true true false 6 Long 0 6 ,First,#,in_memory\\ConduitsToLine,Id,-1,-1;CONDUIT_SH \"CONDUIT_SH\" true true false 254 Text 0 0 ,First,#,in_memory\\ConduitsToLine,CONDUIT_SH,-1,-1;MATERIAL \"MATERIAL\" true true false 254 Text 0 0 ,First,#,in_memory\\ConduitsToLine,MATERIAL,-1,-1;SPAN \"SPAN\" true true false 19 Double 8 18 ,First,#,in_memory\\ConduitsToLine,SPAN,-1,-1;RISE \"RISE\" true true false 19 Double 8 18 ,First,#,in_memory\\ConduitsToLine,RISE,-1,-1;WATERTYPE \"WATERTYPE\" true true false 20 Text 0 0 ,First,#,in_memory\\ConduitsToLine,WATERTYPE,-1,-1;STREET_NAM \"STREET_NAM\" true true false 254 Text 0 0 ,First,#,in_memory\\ConduitsToLine,STREET_NAM,-1,-1;COUNTY_MAI \"COUNTY_MAI\" true true false 254 Text 0 0 ,First,#,in_memory\\ConduitsToLine,COUNTY_MAI,-1,-1;FACILITYID \"FACILITYID\" true true false 9 Long 0 9 ,First,#,in_memory\\ConduitsToLine,FACILITYID,-1,-1;BASIN \"BASIN\" true true false 60 Text 0 0 ,First,#,in_memory\\ConduitsToLine,BASIN,-1,-1;MD_OUT \"MD_OUT\" true true false 19 Double 8 18 ,First,#,in_memory\\ConduitsToLine,MD_OUT,-1,-1;CES_NOTE \"CES_NOTE\" true true false 50 Text 0 0 ,First,#,in_memory\\ConduitsToLine,CES_NOTE,-1,-1;MD_IN \"MD_IN\" true true false 19 Double 8 18 ,First,#,in_memory\\ConduitsToLine,MD_IN,-1,-1;CONDU_LEN \"CONDU_LEN\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,CONDU_LEN,-1,-1;US_INV_ELV \"US_INV_ELV\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,US_INV_ELV,-1,-1;DS_INV_ELV \"DS_INV_ELV\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,DS_INV_ELV,-1,-1;US_GR_ELV \"US_GR_ELV\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,US_GR_ELV,-1,-1;DS_GR_ELV \"DS_GR_ELV\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,DS_GR_ELV,-1,-1;CON_GRADIE \"CON_GRADIE\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,CON_GRADIE,-1,-1;SLOP_COREC \"SLOP_COREC\" true true false 100 Text 0 0 ,First,#,in_memory\\ConduitsToLine,SLOP_COREC,-1,-1;Avg_Depth \"Avg_Depth\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,Avg_Depth,-1,-1;Max_Depth \"Max_Depth\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,Max_Depth,-1,-1;Min_Depth \"Min_Depth\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,Min_Depth,-1,-1;Temp \"Temp\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,Temp,-1,-1;MinDep_RIS \"MinDep_RIS\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,MinDep_RIS,-1,-1;Min_dp_adj \"Min_dp_adj\" true true false 50 Text 0 0 ,First,#,in_memory\\ConduitsToLine,Min_dp_adj,-1,-1;US_NODE \"US_NODE\" true true false 9 Long 0 9 ,First,#,in_memory\\ConduitsToLine,US_NODE,-1,-1;DS_NODE \"DS_NODE\" true true false 9 Long 0 9 ,First,#,in_memory\\ConduitsToLine,DS_NODE,-1,-1;TRENCH_TW \"TRENCH_TW\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,TRENCH_TW,-1,-1;Subbasin \"Subbasin\" true true false 12 Text 0 0 ,First,#,in_memory\\ConduitsToLine,Subbasin,-1,-1;Roughness \"Roughness\" true true false 19 Double 0 0 ,First,#,in_memory\\ConduitsToLine,Roughness,-1,-1;Temp_FAC_I \"Temp_FAC_I\" true true false 50 Text 0 0 ,First,#,in_memory\\ConduitsToLine,Temp_FAC_I,-1,-1;Exist_LOS \"Exist_LOS\" true true false 9 Text 0 0 ,First,#,in_memory\\ConduitsToLine,Exist_LOS,-1,-1;CIPP_LOS \"CIPP_LOS\" true true false 9 Text 0 0 ,First,#,in_memory\\ConduitsToLine,CIPP_LOS,-1,-1;OpnCut_LOS \"OpnCut_LOS\" true true false 9 Text 0 0 ,First,#,in_memory\\ConduitsToLine,OpnCut_LOS,-1,-1;Upgrad_LOS \"Upgrad_LOS\" true true false 9 Text 0 0 ,First,#,in_memory\\ConduitsToLine,Upgrad_LOS,-1,-1;Shape_le_1 \"Shape_le_1\" true true false 0 Double 0 0 ,First,#,in_memory\\ConduitsToLine,Shape_length,-1,-1;FacID_Text \"FacID_Text\" true true false 100 Text 0 0 ,First,#,in_memory\\ConduitsToLine,FacID_Text,-1,-1;Length \"Length\" true true false 0 Double 0 0 ,First,#,in_memory\\ConduitsToLine,Length,-1,-1;RAR \"RAR\" true true false 0 Double 0 0 ,First,#,in_memory\\ConduitsToLine,RAR,-1,-1;RAL \"RAL\" true true false 0 Long 0 0 ,First,#,in_memory\\ConduitsToLine,RAL,-1,-1", "HAVE_THEIR_CENTER_IN", "", "")

# -----------------------Check Select Layer By Attribute

# Process: Add Field (11)
arcpy.AddField_management(SurfaceDifference, "VolBelow", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Add Field (12)
arcpy.AddField_management(SurfaceDifference, "VolAbo", "DOUBLE", "", "", "", "", "NON_NULLABLE", "NON_REQUIRED", "")

# Process: Calculate Field (12)

inTable = SurfaceDifference
fieldName = VolAbo
expression = "getClass(int(!Code!)))"
codeblock = """def getClass(Code):
    if Code = -1
        return !Volume!
    if Code > -1
        return 0
    else:
        return 3"""

arcpy.CalculateField_management(inTable, fieldName, expression, "PYTHON", codeblock)
                                 

fieldName2 = VolBelow
expression2 = "getClass(int(!Code!)))"
codeblock2 = """def getClass(Code):
    if Code = -1
        return 0
    if Code > -1
        return !Volume!
    else:
        return 3"""

arcpy.CalculateField_management(inTable, fieldName2, expression2, "PYTHON", codeblock2)

#----------------------------Surface Difference To Point

arcpy.FeatureToPoint_management(SurfaceDifference,SurfDiffPts,"INSIDE")

# Process: Spatial Join
arcpy.SpatialJoin_analysis(TrenchBoundaryJoinedToConduit, SurfDiffPts, TrenchBoundaryJoinedSurfaceDiff, "JOIN_ONE_TO_MANY", "KEEP_ALL",
                                 
# Process: Frequency
arcpy.Frequency_analysis(TrenchBoundaryJoinedSurfDiff, SurfacDifferanceSummary, "FACILITYID", "VolBelow;VolAbo")
0 Kudos