cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

macros in creo

ptc-231240
2-Explorer

macros in creo

What is the macro language for Creo?

5 REPLIES 5

By itself, there isn't one.

Creo can record interactions with the system and replay them - these are mapkeys.

One can control Creo using its Weblink, JLink, or VBA interfaces or go for the big adventure and use Pro/Toolkit (or whatever it got renamed) using more advanced (compiled language) programming environments like Visual Studio.

You can also use a middling approach - using the regular user interface under software control with AutoIT or VBA, or some other user-interaction simulation.

And you can create trail/training files that can be run like giant mapkeys.

What sort of results are you thinking about?

...and there are user defined features (UDF) ...and the less smart but always useful Sketch Palette.

what im trying to do is get an assembly to cut clearances and hole patterns on import of the hydrolic cylinder automatically.

if it does it on import automatically, i do not have to draw the holes, and clearance cuts each time. and they will always be right.

ive got a hidden surface quilt that i can solidify to cut it out but the macro isnt selecting the feature properly. and skipping the solidify.

the mapkey i have is below. it was patched together from a trial file.

mapkey cut @MAPKEY_LABELcutholes;\

mapkey(continued) ~ Command `ProCmdMdlTreeFilter`

mapkey(continued) !%CIChecked feature types will be displayed in the model tree.

mapkey(continued) ~ Activate `mdl_filter` `feat_btn` 1;\

mapkey(continued) ~ Activate `mdl_filter` `ok_btn`;\

mapkey(continued) ~ Expand `main_dlg_cur` `PHTLeft.AssyTree` `node1`;\

mapkey(continued) !Expanded CLAMP.ASM;\

mapkey(continued) ~ Expand `main_dlg_cur` `PHTLeft.AssyTree` `node10`;\

mapkey(continued) !Expanded ILC25220901_.PRT;\

mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `node23`;\

mapkey(continued) !Extrude 3;\

mapkey(continued) ~ Command `ProCmdFtPatch`;\

mapkey(continued) ~ Activate `main_dlg_cur` `chkbn.intersect_parts.0` 1;\

mapkey(continued) ~ Activate `intersect_parts.0.0` `PH.AutoUpdButton` 0;\

mapkey(continued) @MANUAL_PAUSEremove every part but one you want to cut.;\

mapkey(continued) ~ Open `intersect_parts.0.0` `PH.SelLevelList`;\

mapkey(continued) ~ Close `intersect_parts.0.0` `PH.SelLevelList`;\

mapkey(continued) ~ Select `intersect_parts.0.0` `PH.SelLevelList` 1 `Part`;\

mapkey(continued) ~ Activate `main_dlg_cur` `dashInst0.Done`;

Interesting problem.

I think you've noticed that mapkeys/trail file recording captures positions, not selections. Unless everything in each list is the same, the mapkey recorded that way won't work.

What may work better is to include a search for the item of interest (binoculars) The item of interest should be the only item on the results list, making its list position the same, and allowing the mapkey to proceed. You'd likely create a Query and save it, then use the mapkey to open the query in whatever assembly you are working in.

If a search isn't possible, then you can have the mapkey pause** so you can make selections. Once made, you can resume mapkey execution. Pauses can be recorded while making the mapkey and can include prompts to remind the user what selections need to be made.

**I notice there is a Pause in your mapkey, but others reading this may not.

You should use "search command" to select features instead of picking by mouse.

Then, you can record mapkeys properly.

Announcements
Business Continuity with Creo: Learn more about it here.

Top Tags