Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Creo Automation and Macros

Creo Automation and Macros

Creo Automation and Macros

I come from Catia and have written a ton of codes to help automate the repetitive tasks.

What is the best way to do this in Creo?
I have seen a few options, but I haven't spent a significant amount of time to figure any of them out.

The options I have seen include:
Pro Program, J-Link, AutoIt, p-Shellm, and Mapkeys (which I have used and do not like for very detailed automation.

Some things I would like to do are put in sketches, holes, and pads based on a few inputs (Center Datums, Top, Bottom, Left, and Right side of the blocks.

RE: Creo Automation and Macros

Pro/Program - this is exposing the underlying structure of the parametric evaluation scheme. One can affect only existing elements of the model; there are if-then structures to suppress or resume and a few parameter changes, but there are no loops and it cannot be used to create new features or delete existing ones.

J-Link - a bit more like what I expect you have seen in Catia.

AutoIt - an external program that can act just like a user, but PTC doesn't expose a lot of information for feedback. I've used it for automating a bunch of things but not model feature creation.

p-Shellm - I've not heard of it.

Mapkeys - these simply replay key and mouse functions and have no loop, no feedback, no if-then structures. I've used them in conjunction with the Query functions in Creo to reliably select features or layers, but it's not easy. OTOH, with the correct prep I used VBA from Excel to generate complex Mapkeys to create models and then 80% complete drawings saving hundreds of manual hours and ensuring uniformity of the results.

If I had a big project I would look at http://www.creoson.com/ which has a good following and seemingly good support. It's a follow-on to the also effective Nitro- series of programs - Nitro-Cell, Nitro-BOM, and Nitro-PROGRAM.

One factor that makes this a bit odd is that the original reason Catia has so much programming capability is they did not have the depth of feature creation, particularly of patterns, that PTC started with. One big chunk of the way PTC was originated was to eliminate the need for users to create software to get results. Instead of creating a complex program to add a feature, one can create a UDF (user defined feature) and just add that to the model. The UDF contains all the references needed to place it, so there's far less need to write a lot of code. Since most things about the feature are parametric, one can alter it by just altering the parameter/dimensions after placing it. Many of the programs I've seen automated in other software are tasks like creating staircases or patterns of features.

Instead of creating a program to create a feature - you can create a Mapkey that places a UDF using the Search/Query function to chose named elements in your model. This saves manually choosing the references and avoids getting into the raw feature API which is not well exposed by PTC to anyone. Here's an example of doing something like that with the VB-API (similar to J-Link/Web-Link) https://creoauto.blogspot.com/2014/09/inserting-ud...

It used to be about $10k to get the Pro/Tool-kit license to get to the raw feature API.

OTOH - I've also seen an example with a company that automated building large welded towers with thousands of weld details, including creating the cut drawings ready for the plasma cutter; so it's not like there isn't room in Creo for automating tasks like that.

RE: Creo Automation and Macros

I appreciate the very detailed break down of all of my options.

I will definitely be looking into Creoson.

I am very interested in your ability to use Excel VBA to create Creo Models and Drawings.
I have a lot of experience with Catia and Excel VBA and would definitely like to pursue something like this.

Could you provide me some simple examples or places i can see how to start doing this?
I would like to do some of this for Models and Drawings.

RE: Creo Automation and Macros

What I did was use the mapkey recorder and trail files to capture individual tasks and then sort through the resulting file to find the essential functionality - PTC records a large amount of extraneous information in mapkeys. Of particular note is that mapkeys and trail files aren't a language. They are recording the UI operations; there is no documentation of the UI to rely on.

Then I created VBA code to generate variations of those recordings.

Since the UI changed at each software revision trail files and mapkeys didn't always continue to work, so it's not reliable to create a large library of complex ones. More typical things PTC tended to keep the old software under the hood, so things like Zoom-In and Zoom-Out worked, but creating features I would not expect to work between major revisions. I don't expect PTC has changed that behavior.

For example of how much fun it can be - suppose one wants to place a symbol on a drawing. If one clicks to do that, when making the recording, Creo records the percentage of apparent screen width that is scaled depending on the aspect ratio of the drawing format, rather than the expected X and Y coordinates in the drawing coordinate system.

Start simple. Make a mapkey that places a single thing and then look at what was recorded. The functional part was not always obvious to me so I would start by deleting anything that didn't look functional.

Oh - the first mapkey to make is one that loads mapkeys so that after you edit them with a text editor you can get Creo to use the new version. You are also not limited in naming the mapkey files; AFAIK Creo doesn't really care about the filename, just the contents.

Also -

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close