Yes, the parent directory is registered and I believe it is a drive mapped path (though I am fairly new in this area so am not entirely sure.) I am unable to share the full script, but here are the parts I can share were it errors at
output_workspace = arcpy.GetParameterAsText(0) #folder
geodatabase_name = arcpy.GetParameterAsText(1) #string
os.mkdir(output_workspace + '//' + geodatabase_name)
output_workspace = output_workspace + '//' + geodatabase_name
def create_new_constraints_pdf(output_workspace, geodatabase_name, output_geodatabase):
aprx = arcpy.mp.ArcGISProject(path to aprx) #aprx gets copied to web tool
arcpy.env.workspace = output_geodatabase
map = aprx.listMaps()[0]
constraints_lyr = output_workspace + '//' + 'constraints' + '.Lyrx'
lyrFile = arcpy.mp.LayerFile(constraints_lyr)
lyt = aprx.listLayouts()[0]
legend = lyt.listElements("LEGEND_ELEMENT")[0] #Calls Legend Element
legend.syncNewLayer = True #Makes all newly added layers appear in legend
map.addLayer(lyrFile, 'Top')
for lyr in map.listLayers(): #For statement will properly color layers on map
if lyr.isFeatureLayer:
sym = lyr.symbology
if hasattr(sym, 'renderer'):
if sym.renderer.type == 'SimpleRenderer':
sym.updateRenderer('GraduatedColorsRenderer')
sym.renderer.classificationField = "total_score"
sym.renderer.breakCount = 5
lyr.symbology = sym
lyr = map.listLayers()[0]
lyr.transparency = 20 #Sets transparency to 20%
legend.syncLayerVisibility = True #Places all layers on map into legend
lyt.exportToPDF(output_workspace + '//' + 'transparent') #(Errors out here)
map.clearSelection()