Skip to main content
1-Visitor
Mar 9, 2019 9:31 AM UTC
Solved

Python for creo automation

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

RPN
RPNAnswer
18-Opal
Mar 10, 2019 5:53 PM UTC

Hmm, not Python but Tcl

 

You can read this

Check the "Export Data" section.

Or view this at YouTube

18 replies

RPN
RPN18-OpalAnswer
18-Opal
Mar 10, 2019 5:53 PM UTC

Hmm, not Python but Tcl

 

You can read this

Check the "Export Data" section.

Or view this at YouTube

Translate
24-Ruby III
Mar 11, 2019 8:49 AM UTC

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".

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

Hi,

I learned by trial and error 🙂

Translate
FV_01
Mar 14, 2019 9:45 PM UTC

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


 

Translate
sammy19941-VisitorAuthor
1-Visitor
Mar 15, 2019 3:43 AM UTC
Oh okay! Thank you for your response
Translate
18-Opal
Jun 22, 2019 7:40 PM UTC

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

Translate
24-Ruby III
Jun 25, 2019 10:04 AM UTC

@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 ?

Translate
18-Opal
Jun 25, 2019 2:25 PM UTC

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!

 

 

Translate