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

Creo 2 - Pro/PROGRAM - Reading a parameter from a Creo file

Highlighted
Newbie

Creo 2 - Pro/PROGRAM - Reading a parameter from a Creo file

Hello all

I searched all Creo documentation available on the following topic but could not find any answer so far.

I would like to know whether it is possible to pilot (via Pro/PROGRAM) the presence of a function in a part (or any function in any model tree of a part or an assembly) thanks to the value of a YES-NO parameter that would be defined in another Creo file (PRT or ASM).

I manage to do it by reading the value of this parameter in a text file (i.e. a NON Creo document, stored out of my Windchill workspace), but I would prefer to have this parameter stored in a specific Creo file (PRT or ASM) that would be in memory at the same time as the part where I want to have the function present or no present.

I did use Pro/PROGRAM quite good some fifteen years ago, but unfortunately I have forgotten almost everything since and kept no document form this past era).

Many thanks advanced and kind regards,

Jean-Michel.

3 REPLIES 3
Highlighted

Re: Creo 2 - Pro/PROGRAM - Reading a parameter from a Creo file

When I use relations in an assembly, I can use parameters from one part or assembly to calculate things and set parameters in other part or assembly files. To do this you need to use the Session ID of the parts/assemblies to reference the right one. For example:

param1 = param2:4

Uses the value of "param2" from the part with session ID of 4 to set the "param1" of the current part/assembly.

To have it work robustly, you might need to have a "top-level" assembly that includes all the parts and assemblies you want to use for relations, and put all those relations in that assembly. Otherwise you won't ever be assured that all the parts needed are in memory, that your session IDs are correct, etc.

Highlighted

Re: Creo 2 - Pro/PROGRAM - Reading a parameter from a Creo file

Thank you for the tips. This is something I already knew, but not what I was thinking about in my question.

In fact, I would like to have my part/assembly that I want to pilot use the value of a parameter that is in memory directly, without having to write relations.

One file (in session) has the parameter defined with a value, another file, also in memory, has a relation that use this parameter.

If the first file is closed, removed from memory, and replaced by another one with different values for the same parameter, then the second file, the one with the relation, adapt itself to the new value.

Having to use the part ID would require me to check for this value (probably changing when one component is replaced by another one), and this is what I want to avoid by using Pro/PROGRAM.

Highlighted

Re: Creo 2 - Pro/PROGRAM - Reading a parameter from a Creo file

I only use EXECUTE statements in an assembly to drive the components of that assembly (parts and/or subassemblies). Those parts/subassemblies have their own INPUT parameters.

Announcements