Skip to main content
1-Visitor
Nov 5, 2014 1:04 PM UTC
Question

Get parameter value using J-link

Hello!

 

I'm trying to get the value of a parameter, but it is returning this:

com.ptc.pfc.Implementation.pfcModelItem$Parameter@1187b50

 

I'm trying to get the parameter like this:

Parameter p;

p = (Parameter) model.GetParam("DESCRICAO");

txtDescricao.setText(p.toString());

 

 

This parameter exists in the model:

Capturar.PNG

 

Could someone help me?

 

Thank you!

5 replies

4-Participant
Nov 5, 2014 1:09 PM UTC

may be this is the ptc_common_name, this the model name, not an ordinary parameter.

This can be tested by changing the language setting of Creo (or Pro/E), if the parameter name change from DECRICAO to DESCRIPTION, then it is the ptc_common_name.

To access this parameter, you have to use the model name.

Translate
1-Visitor
Nov 5, 2014 1:30 PM UTC

I am not using ptc_common_name parameter.

This parameter was created. It is not a common parameter.

The value of this parameter is manually entered.

Translate
13-Aquamarine
Nov 5, 2014 2:02 PM UTC

Try this:

//assuming you already have a handel to a Creo model with String parameter "DESCRICAO"

Parameter param = model.GetParam("DESCRICAO");

ParamValue paramVal = param.GetValue();

String strParamVal = paramVal.GetStringValue();

txtDescricao.setText( strParamVal );

Translate
1-Visitor
Nov 5, 2014 3:44 PM UTC

Thanks Tom Decock!

It worked as expected!

Translate
13-Aquamarine
Nov 5, 2014 3:54 PM UTC

Hi Sulmaq,

Glad to help. Could you mark the answer as being correct ? Otherwise the status remains "not answered" 😉

Translate