sandrine_carmet

Addlayer error

Discussion created by sandrine_carmet on Aug 8, 2014
Latest reply on May 3, 2015 by sephefox
Branched from an earlier discussion

Hello! I'm having the same problem...

Just to better understand, if I'm not using path but defined parameters, I can not write :

 

   # Add shp to mxd

  mxd =arcpy.mapping.MapDocument("CURRENT")

  df = arcpy.mapping.ListDataFrames(mxd)[0]

  addLayer = arcpy.mapping.Layer(OutputSHPFile)

  arcpy.mapping.AddLayer(df, addLayer, "TOP")

  arcpy.RefreshActiveView()

  arcpy.RefreshTOC()

 

Where OuputSHPFile = parameters[3].valueAsText  ??

 

Is there a way to get my OutputSHPfile as a string and then use it in the "addLayer" ?

 

 

Thanks.

Outcomes