AnsweredAssumed Answered

Explain arcpy.SetParameterAsText to me like a 5th Grader.....

Question asked by tpcolson on Jun 18, 2018
Latest reply on Jul 17, 2018 by tpcolson

So this is something new to me that is manifesting itself in Pro and that is Setting script tool parameters—Geoprocessing and Python | ArcGIS Desktop. In particular, "The tool modifies the schema of the input, ", which, an ESRI employee told me derives from "Your script tools need to use derived outputs to indicate to the multithreaded geoprocessing framework that something was updated within your script code". Since this stuff works in Arc, but I'm seeing the issue in Pro, I'm guessing that's where multithreaded comes into play. 

 

So here's the problem. With the attached toolbox, run Create Folders -> Create GDB -> Add attributes (check both boxes). What happens is, the folders get created, the GDB get's created, the extended attributes get created, the extended domains get created, but the domains created with the last tool don't appear in right-click GDB -> Domains, not do the domains get assigned to the attributes (because the tool doesn't believe they exist). Close Pro. Go to Arc Cat, the extra two domains created by the 3rd tool (and the assignment to the attributes) are there and correct. Restart Pro. There they are. 

 

I completely understand that some sort of tool parameter wizardry has to occur here for the 3rd tool to recognize the domains have been added, and let the tool know that so it can continue with the next steps which is assign the domains to the attributes. 

 

The attached toolbox was edited by the helpful ESRI person in another forum, but I'm not having that "ahhhhh that makes sense" moment when trying to extend it, or, even make it work (for some reason it worked once, but post-many-reboots, the original behavior is occurring, the domains aren't showing up (even though they're really there). 

Attachments

Outcomes