TransWikia.com

Adding shapefiles to specific .mxd project using ModelBuilder

Geographic Information Systems Asked by pmurbina87 on March 29, 2021

I am new to automating geoprocesses.

In ModelBuilder, I conducted a geoprocess of transforming some points in excel to a shapefile, and then to make a buffer of 4 kms to these.

As a result, two shapefiles are produced, like the ones I mentioned above.

I leave you a screenshot :

enter image description here

In the same ModelBuilder, is there a way to automatically add these two shapefiles to a given .mxd project?

One Answer

Yes. If you're running the tool as a tool (not from the Model window), you need to make model parameters. If something is a parameter, the default geoprocessing environment is set to add those outputs to your map. Note - you cannot add the result to an MXD other than the one you're in. To do that, you'll need to write a Python script, make that into a tool and add that as a sub-tool to your model.

In short:

  • Expose the outputs as parameters
  • Run the tool from the toolbox (not model window)
  • Make sure your geoprocessing environment setting adds output to the map

Read more about model parameters

Answered by KHibma on March 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP