Select to view content in your preferred language

Export Output of Collect Values Tool in Model Builder

4308
14
03-23-2013 11:48 AM
ShinoRah
Emerging Contributor
Hi There,

I am new to model builder, I have built a model which calculates mean and minimum distance between features. It also counts how many of those near features fall within a given 'buffer' around a feature.

The user can select upto 6 buffer (/radius) lengths.  The tool will run and the final result is an excel file.  The excel file includes how many features fell within that given buffer but does not include the buffer distances that the user manually input in the beginning. 

So for those forgetful users, I'd like to add a column in the excel file that shows the buffer length.  I have added an image to this post, which shows visually what I want, because I'm not sure how coherent this explanation is.

Hopefully there is someone out there who can help me.  I've tried the merge, union and calculate values tool to somehow bring it all together, but no luck.

Thanks in advance!!
0 Kudos
14 Replies
ShinoRah
Emerging Contributor
Hi Curtis,

Is it possible to have many input tables for the "Export table to MS Excel" tool?

From what I've read, I don't think this is possible, and when I tried to connect the Radius output to it, the connection with the 'output table' automatically disappears and many of the tools go blank.

Perhaps there is a similair tool to 'export table to MS excel' that allows multiple input?

Or maybe there is a way I could do this where I continue trying to connect the radius output to the merge tool, as I had initially?

Any thoughts you have on this will be very much appreciated!!

Thanks!
0 Kudos
curtvprice
MVP Esteemed Contributor
I think you're missing something.

The Calculate Value tool I wrote for you takes the output of the Merge (the precondition connect just makes the merge happens first) and modifies that table. The CV output should then go to the your export tool (make sure it is set to type TABLE  so it will be accepted by the tool!)  The merge output should not be connected to your export tool.
0 Kudos
ShinoRah
Emerging Contributor
Hi Curtis,

Thanks again for your response. I have made the following changes:

I have diconnected the merge output from the export to excel tool and replaced it with the output of the CV tool.  Now the output of the CV tool is the input to the Export to Excel. 

Under the 'Fields to Export' (in the export to excel tool), I have no options as I did when the merge tool was connected. 

Not having a selection for this field is not allowed by the tool and so the tool remains blank.

Just wondering how I can fix that?  Am I supposed to have fields in this 'Radius' table?

Thanks agian,
0 Kudos
curtvprice
MVP Esteemed Contributor
It appears the export to excel tool needs validation that Calculate Value can't provide.

For the validation to work, connect the Merge output to Add Field and add the RADIUS field. Connect the output of Add Field to your export tool. This way the export tool will be aware of your new field.

But you still want to populate that RADIUS field with values, so:

Connect the output of Add Field to the Calculate Value tool as a precondition, and the CV's output to the export tool as a precondition.

I'm not sure this will all work, but it's worth a try.
0 Kudos
ShinoRah
Emerging Contributor
Hi again,


Ok I think I am getting close thanks to all of your help!

Any clue what this error means ..

ERROR 000539: Error running expression: RadiusTable(r"Z:\Scratch\srah\130114_temp1.dbf","'600 Meters';'750 Meters';'1000 Meters';'1500 Meters';'2000 Meters';'2500 Meters'") <class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.

Thanks!
0 Kudos