Skip to main content
1-Visitor
October 30, 2017
Solved

CREO 2.0 - Macro like function?

  • October 30, 2017
  • 1 reply
  • 3512 views

Hello community,

 

recently I started working for a company that uses CREO 2.0 . 

 

I am currently trying to understand CREO's capabilities regarding "automation".

 

One of the "simple" things I would like to do, I think is well defined in my head but have no idea if there is a relatively simple way to achieve with CREO's built in tools (the company only has CREO Parametric licences).

 

So here it goes:

 

Given:

  • I have previously created a template-part file (PART.PRT) where I have defined a geometry based on 3 reference points P1,P2 and P3.
  • I am currently working on an assembly (ASSY.ASM) where I manually create 3 points (A1,A2 and A3).

At this point I would like to start a macro which would do the following:

 

  1. Browse to the location where the PART.PRT is saved
  2. Import/ assemble PART.PRT into the ASSY.ASM
  3. Activate(?) the part, replace P1,P2, and P3 with A1,A2, and A3 respectively by looking for the specific names (the names will be specified in the code: "look for P1-->replace with A1") (theoretically all other features of the part template should be automatically updated)
  4. Optional: Prompt for saving the PART.PRT with a new name (and the updated geometry)

 

I think something like this is relatively easy in VBA or similar but after experimenting a bit I cannot see a possibility to do it in Pro/Program.

 

I hope someone with more experience can enlighten me.

 

Thanks!!!

 

Best answer by dschenken

You can create a User Defined Feature (UDF) that references those points. In the assembly create a new part and then use the UDF placement to refer to the points.

 

If you like, you can use a mapkey or trail file to reproduce the steps.

1 reply

dschenken1-VisitorAnswer
1-Visitor
October 31, 2017

You can create a User Defined Feature (UDF) that references those points. In the assembly create a new part and then use the UDF placement to refer to the points.

 

If you like, you can use a mapkey or trail file to reproduce the steps.

GI_2715361-VisitorAuthor
1-Visitor
November 2, 2017

Thank you for the reply  @dschenken ! Really helpful and I could make some progress.

 

I kind of managed to  achieve a basic version of what I wanted to do with a UDF.

 

I am currently trying to make a "hybrid" version of UDF and Pro/Program.

 

What I basicaly want to do is the following:

The part which I would like to use as my UDF basis has a basic PRO/Program where the user is prompted to input a number (2 or 3):

 

  • If the number entered by the user is 2 some features are activated 
  • If the number entered by the user is 3 some other features are activated

 

This unfortunately requires that features for both inputs (2 or 3) are already defined at the tree and they are mutually suppressed (when 2 was input by the user, the features for 3 are suppresed and the other way around).

 

 

This works fine at part level.

 

 

The problem now is that I am trying to define a UDF,  and I cannot pick the suppressed features so that everything could also work at UDF level. 

Idealy I would like to insert a UDF and once I click on it, I am first prompted to enter the number (2 or 3) and then I can select my points and based on the number I entered I get the respective features.

 

Would something like that be possible?

 

Thanks!

 

 

 

 

 

 

 

 

 

 

12-Amethyst
November 3, 2017

would a family table UDF work for you? you could create two instances, one with the features that go along with selecting 2 and the other with features that go along with selecting 3. this might eliminate the need for pro-program. you will not end up with any suppressed features using the UDF and if you leave the features grouped you could replace the two instances with each other.