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

Get Parameter value from parent

hdasilva
14-Alexandrite

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

ACCEPTED SOLUTION

Accepted Solutions
TomU
23-Emerald IV
(To:hdasilva)

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%2FTo_Specify_a_Parameter_in_Another_Model.html%23

 

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
TomU
23-Emerald IV
(To:hdasilva)

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%2FTo_Specify_a_Parameter_in_Another_Model.html%23

 

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

hdasilva
14-Alexandrite
(To:TomU)

That's exactly what I was looking for 🙂

Thank You!

hdasilva
14-Alexandrite
(To:TomU)

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

TomU
23-Emerald IV
(To:hdasilva)

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


Top Tags