Skip to main content
1-Visitor
March 9, 2019
Solved

Python for creo automation

  • March 9, 2019
  • 4 replies
  • 26171 views

Can i use python for automating boring and repeating stuff in creo?? 

Like batch processes(converting to iges/step) and using parameter value as input to filename

Best answer by RPN

Hmm, not Python but Tcl

 

You can read this

Check the "Export Data" section.

Or view this at YouTube

4 replies

RPN18-OpalAnswer
18-Opal
March 10, 2019

Hmm, not Python but Tcl

 

You can read this

Check the "Export Data" section.

Or view this at YouTube

24-Ruby III
March 11, 2019

Hi,

I am able to automate Creo tasks using AutoIT + Creo mapkey + Creo trail file.

As far as know there is no "python API for Creo".

sammy19941-VisitorAuthor
1-Visitor
March 11, 2019
Thank you for your response.
How did you learn about how to use creo trail files? I mean there is no
documentation available online
24-Ruby III
March 11, 2019

Hi,

I learned by trial and error 🙂

17-Peridot
March 14, 2019

if automating with python meant using creo's COM type libraries than it should be doablepython-creo.png

python will import and generate a stab module for whatever is in Creo Type Library but the end result will be the same quite limited functionality as with VB. 

 


@sammy1994 wrote:

Can i use python for automating boring and repeating stuff in creo?? 

Like batch processes(converting to iges/step) and using parameter value as input to filename


 

sammy19941-VisitorAuthor
1-Visitor
March 15, 2019
Oh okay! Thank you for your response
17-Peridot
June 22, 2019

Actually - there IS a way to automate Creo with Python. -- "creopyson" was just released as an OpenSource Project that builds on the already OpenSource CREOSON Project.

 

It was JUST released as an interface to CREOSON - which is an OpenSource interface to Creo.

 

Here is the link to creopyson --> https://github.com/Zepmanbc/creopyson (requires CREOSON)

 

Here is the link to CREOSON --> http://www.creoson.com/

 

As the developer/maintainer of CREOSON, we are super impressed by the feedback and contributions to this OpenSource Project!

 

Dave

24-Ruby III
June 25, 2019

@DavidBigelow wrote:

Actually - there IS a way to automate Creo with Python. -- "creopyson" was just released as an OpenSource Project that builds on the already OpenSource CREOSON Project.

 

It was JUST released as an interface to CREOSON - which is an OpenSource interface to Creo.

 

Here is the link to creopyson --> https://github.com/Zepmanbc/creopyson (requires CREOSON)

 

Here is the link to CREOSON --> http://www.creoson.com/

 

As the developer/maintainer of CREOSON, we are super impressed by the feedback and contributions to this OpenSource Project!

 

Dave


Hi,

I haven't had time to examine the creopyson yet. David, can you please tell me the benefits of using the python+creopyson over the python+creoson ?

17-Peridot
June 25, 2019

Martin,

 

TLDR;

creopyson would be an example of someone (an awesome guy in France) that build a wrapper for CREOSON functions so that a any other user would not have to create their own.  Basically to help other python users "get there faster" for Creo Automation using CREOSON...  Specifically, load library, initialize, and start using - without having to first build the technical bits for the communication first in python to communicate with the CREOSON server.

 

DEEPER EXPLANATION;

CREOSON was developed to be a generic bi-directional service interface into Creo for performing optimized actions via JLINK (e.g. simpler -more obvious- commands, with more options via standard JSON transactions - from ANY language).

 

The core premise of CREOSON was to pass a standard JSON structure over HTTP to a service endpoint - locally or over a network.

 

Because CREOSON uses HTTP as the main interface for transacting requests, ANY language can be used to communicate with it (e.g. VB, Javascript, Java, Python, PHP, etc..) that supports HTTP transactions.

 

Some languages have HTTP interfaces baked-in, others use libraries to perform the actions as optional packages. It is typically up to the user to define the HTTP interface (simple send/receive function that communicates with the CREOSON server) and then write the function(s) for specific CREOSON requests.

 

Typically users create their own function for say opening a model (e.g. myOpenModel(fileName);) that would take an input argument (like fileName) and build the CREOSON JSON request and execute it, then handing the response.  This process would likely be repeated for each function they wanted to use in their application (build a wrapper function that builds and calls CREOSON and responds for their own purpose).

 

So - creopyson is an opensource contribution (from someone in France) who loved CREOSON and wanted to make it even easier to use with python by pre-building all the interfaces in python to call CREOSON - and contributed it for everyone else to use who love phython also.  A pretty awesome OpenSource contribution!