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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Translate the entire conversation x

Jlink using the GetSymbol() on a Dimension

lococnc
1-Visitor

Jlink using the GetSymbol() on a Dimension

I am reading info from a text file and modifying dimensions and
parameters in a model.

II have it working fine setting a parameter using the following code
(with the line from a text file passed using scanner);

String parameterName = lineScanner.next();
String parameterValue = lineScanner.next();
ParamValue pV;
Parameter p;
pV = CreateParamValueFromString(parameterValue);
p = skeletonModel.GetParam(parameterName);
p.SetValue(pV);

But how do I get this to do the same with a dimension that has been
given a name (i.e. not just d1). The Symbol of the dimension is d1 and
I have successfully set the dimension to a value using it's symbol
name.

How do I translate the "parameter name" into this symbol name?

Looks like I need to use the GetSymbol() method but this only works on
the object type of "Dimension"

I know this is correct;
String parameterName = lineScanner.next();
double parameterValue = lineScanner.nextDouble();
ParamValue pV;
Parameter p;
pV = pfcModelItem.CreateDoubleParamValue(parameterValue);
String dimSymbol = dim.GetSymbol();
p = currModel.GetParam(dimSymbol);
p.SetValue(pV);

Question is how to code the following line correctly;

Dimension dim = (parameterName);
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
0 REPLIES 0
Announcements
NEW Creo+ Topics: Real-time Collaboration

Top Tags