Can i call a third party toolbar with Python?

2361
8
06-14-2016 12:35 PM
CaseyPetty1
New Contributor

I am using a toolbar from a third party.  This toolbar exports entire layers or selected features from your table of contents and converts them to a Petra Layer file.  I dont use Petra, but i am responsible for providing files to those who do. 

I would like to script something with Python so it can be scheduled to run during the evening.  This will save me tons of manual work. 

Any idea how i can  accomplish this?

0 Kudos
8 Replies
DanPatterson_Retired
MVP Esteemed Contributor

the question is, can you add the toolbar to arcmap?

0 Kudos
CaseyPetty1
New Contributor

Yes, the tool bar has been added to my project and works fine.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

scheduled tasks .... is the key phrase, some examples from help (for scripts)

Scheduling a Python script to run at prescribed times—Help | ArcGIS for Desktop

Exercise 3: Running batch jobs as a scheduled task—Help | ArcGIS for Desktop

plus other examples on GeoNet

0 Kudos
CaseyPetty1
New Contributor

I know how to schedule tasks, that is not the issue.  The issue revolves around calling the third party toolbar.  The toolbar is loaded in my project, and works just fine when i click the buttons on it.  However, it is not native to arcpy so i have no idea if its even possible to utilize it in a script.  Its like a black box that spits out a file format not native to GIS.

Is there a way to call such a tool with Python?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

sorry, I had assumed that the python scripts could be accessed and run within a scheduling script.  Obviously, there is no press this button script

0 Kudos
CaseyPetty1
New Contributor

If it were "obvious" i would not have asked!  I am not a programmer, and i am very new to python.  I assumed that because you can access layers inside an mxd that you might be able to access a toolbar as well.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

ok... so some difference in my perception... you said you wanted to script something ... I will leave others to assess what you can do.

For others this is what you can access through python and within arcmap, there is a similar one for Pro

What is ArcPy?—Help | ArcGIS for Desktop

0 Kudos
DarrenWiens2
MVP Honored Contributor

arcpy lags fairly far behind actual ArcMap functionality (ESRI claims it's by design, "arcpy isn't meant to replace ArcObjects"). Even accessing layers only started at 10.1 through the mapping module, I believe.

Anyhow, I think it depends how the toolbar was created. If it was created in ArcObjects, I don't believe there are any methods to touch it via Python. If it was created as a Python plug-in and you can find the script controlling the functionality, perhaps you can tap directly into that code. But, unless the toolset comes with instructions how to script its tools, I'd say you're fighting an uphill battle.