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

Get Parameter value from parent

SOLVED
Highlighted
Amethyst

Get Parameter value from parent

HI

 

Is there any way to get a parameter value from parent assembly?

 

Example:

Parent assembly has the parameter PROJECT_NAME= ProjectABC

I have the same parameter on the parts "PROJECT_NAME", and I want to populate it with the value from the parent assembly "ProjectABC".

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Get Parameter value from parent

Yes, but you don't use the assembly's name, you use its session id.  See this help page for details:

http://support.ptc.com/help/creo/creo_pma/usascii/#page/fundamentals%2Ffundamentals%2Ffund_seven_sub...

 

You can "push" the assembly parameter down to the model or you can "pull" it from the assembly into the model.  I would suggest pushing from the assembly since the assembly may not be in session if just the model is opened and this can lead to failed relation statements

 

Example

Assembly Session ID: 0

Model Session ID: 1

 

"Push" from Assembly

MODEL_PARAM:1 = ASM_PARAM

 

"Pull" from Model

MODEL_PARAM = ASM_PARAM:0

 

It's fine to use the same parameter name in both places (like you have).  When no session ID is used, the local parameter is automatically referenced.  So your final relation will look something like this in the assembly relations (with a different session ID of course):

PROJECT_NAME:1 = PROJECT_NAME

View solution in original post

4 REPLIES 4
Highlighted

Re: Get Parameter value from parent

Yes, but you don't use the assembly's name, you use its session id.  See this help page for details:

http://support.ptc.com/help/creo/creo_pma/usascii/#page/fundamentals%2Ffundamentals%2Ffund_seven_sub...

 

You can "push" the assembly parameter down to the model or you can "pull" it from the assembly into the model.  I would suggest pushing from the assembly since the assembly may not be in session if just the model is opened and this can lead to failed relation statements

 

Example

Assembly Session ID: 0

Model Session ID: 1

 

"Push" from Assembly

MODEL_PARAM:1 = ASM_PARAM

 

"Pull" from Model

MODEL_PARAM = ASM_PARAM:0

 

It's fine to use the same parameter name in both places (like you have).  When no session ID is used, the local parameter is automatically referenced.  So your final relation will look something like this in the assembly relations (with a different session ID of course):

PROJECT_NAME:1 = PROJECT_NAME

View solution in original post

Highlighted

Re: Get Parameter value from parent

That's exactly what I was looking for 🙂

Thank You!

Highlighted

Re: Get Parameter value from parent

Hello TomU,

 

     I was trying to  put this on our part template, so that when we start a new project, all the parts on it would already have this relation. As our parent assembly always has session ID=1, this could be possible.

     The problem is that I cannot create this on the part template because there, I don't have a parent assembly to refer to, and he doesn't let me create the relation. So,I created an assembly (with session ID=1), and put it on the templates folder, then I put the part template on this assembly and he lets me create the relation. But now I cannot use the part template when I create news parts, because he cannot load the session ID.

     Any Idea on how to handle this?

 

Thanks

Highlighted

Re: Get Parameter value from parent

Unfortunately this won't work.  The parent assembly will not always be session id '1'.  Session ids are assigned based on the order files are opened in Creo.  The first file opened is '0', the next '1', and so on.  Behind the scenes Creo will keep track of the actual model it's referring to, but you have no control over that.

 

Concerning templates, I'm fairly certain you cannot use a model with external references as a template.  This means an assembly template must be empty (nothing assembled to it) and parts must not reference other parts (or assemblies.)

 

There is a way to have a drawing template dynamically link up with the parent part or assembly (see ':mdl' syntax), but there is no way to automatically do this between parts and assemblies.  You will just have to get used to manually creating the relation based on the current session ids.

Announcements