Select to view content in your preferred language

Create "Zip" file in Model Builder

5219
24
Jump to solution
12-09-2021 06:38 AM
Syvertson
Occasional Contributor III

I have a model builder process that will create a shapefile, that later is retrieved by another process.  The other process requires a zip file input.  Is there any way I can zip up these files within model builder?

0 Kudos
24 Replies
anonymous55
Occasional Contributor II

Hello
I can create zip file but the zip file is empty.
zipshape(r"E:\mypath","open")

0 Kudos
curtvprice
MVP Esteemed Contributor

The modelbuilder wrapper I set up asks for a path and a shapefile root name. I will update the function doc to make that clear. For example, your call above assumes you have a shapefile E:\mypath\open.shp

0 Kudos
anonymous55
Occasional Contributor II

I created shape file and added date whenever you run the model. Right  now I am trying to zip the shapefile and then next step rename it like this : "A_todaydate"

ARM_0-1642788256164.png

I don't understand this part. what I need to replace. 
how can I get already shapefile created and zip it.

ARM_0-1642789571173.png

 

 

 

0 Kudos
curtvprice
MVP Esteemed Contributor
I would think you would want to rename the shapefile and then zip it. If this isn’t in a loop you would use parse path on your shapefile to get the folder and shapefile name to pass to this function.
anonymous55
Occasional Contributor II

@curtvprice 
Thanks a lot I can create zip file right now. Just one question do you know how can rename the zip file which I created rename with current date land_TodayDate.zip.

 

0 Kudos