Hello. I find that when I run a python command from my project notebook, the script runs and does what I expect it to. When I run the same code from a toolbox script that I just created, it runs without error but doesn't do anything.
This is the notebook command:
arcpy.cartography.ConvertLabelsToGraphics(
'Map', 20000, 'SINGLE_LAYER', 'XBA/New LTC-SUP/PofC', 'Graphics', 'DISPLAY',
'GRAPHICS_LAYER_PER_FEATURE_LAYER', 'ONLY_PLACED', 'GroupGraphics')
This is the tool script:
import arcpy
def pofctographic():
tenure_type=arcpy.GetParameterAsText(0)
if tenure_type == "LTC-SUP":
arcpy.AddMessage("LTC-SUP selected")
arcpy.cartography.ConvertLabelsToGraphics(
'Map', 20000, 'SINGLE_LAYER', 'XBA/New LTC-SUP/PofC', 'Graphics', 'DISPLAY',
'GRAPHICS_LAYER_PER_FEATURE_LAYER', 'ONLY_PLACED', 'GroupGraphics')
if tenure_type == "CP":
arcpy.AddMessage("CP selected")
arcpy.cartography.ConvertLabelsToGraphics(
'Map', 20000, 'SINGLE_LAYER', 'XBA/New CP/PofC', 'Graphics', 'DISPLAY',
'GRAPHICS_LAYER_PER_FEATURE_LAYER', 'ONLY_PLACED', 'GroupGraphics')
pofctographic()