I'm modelling accessibility, so am using network analyst arcpy.na.MakeServiceAreaAnalysisLayer().

However, I don't want to enter anything for the time_of_day parameter. How do I write my Python script so that I can write parameters after this, but not include time_of_day or time_zone?

I get ERROR 000628: Cannot set input into parameter time_of_day.

I'm a newbie to scripting.


If you do not wish to enter a value for a parameter, you'd typically pass it an empty string. The time_of_day parameter is the 6th parameter (or so I read from the doc).

arcpy.na.MakeServiceAreaAnalysisLayer(network, layer_name,
                                                travel_mode, "FROM_FACILITIES",
                                                [3], "", polygon_detail="HIGH",

However, only the input network parameter is required. You should be able to run the tool just like:


Or, if you only want to provide one optional parameter that isn't the first and not pass in a bunch of empty strings, you can pass a value to the assigned parameter like so:

arcpy.na.MakeServiceAreaAnalysisLayer(network, geometry_at_overlaps="OVERLAP")

(The geometry_at_overlaps is actually the 10th parameter)

To answer the question in the comment, how to use all parameters up till geometry_at_cutoffs, but skipping time_of_day and time_zone:

arcpy.na.MakeServiceAreaAnalysisLayer(network, layer_name,
                                    travel_mode, "FROM_FACILITIES", [1, 2, 3],

(I started making them named parameters for ease of seeing what parameter is where)

  • Thank you, thats helpful! Although I want to use parameters up until geometry_at_cutoffs, just missing the time_of_day and time_zone, would the above still be applicable?
    – JGe
    Jan 4 '17 at 22:02
  • Good answer. I would include a link to the official documentation: pro.arcgis.com/en/pro-app/tool-reference/network-analyst/…
    – Mintx
    Jan 4 '17 at 22:03
  • @JGe I added one more example for what you're doing specifically.
    – KHibma
    Jan 5 '17 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.