Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Is it possible to obtain the dimension object driven by a parameter through the toolkit? Or can you retrieve which parameters drive a given dimension?
I've tried various methods but still can't associate the driven dimension with the parameter by toolkit. Even using the ProFeatureExternParentsGet function only know which model it's related to. The only method I can think of right now is to parse all the relations, but this raises another issue: if there are logical conditions like if-else-endif in the relations, it makes the parsing process more complicated. I'd like to know if there are other ways to achieve my goal. Thank you very much!
extern ProError ProDimensionIsReldriven (
ProDimension *dimension,
ProBoolean *rel_driven);
/*
Purpose: Determines whether the specified dimension is rel_driven.
Input Arguments:
dimension - The dimension handle.
Output Arguments:
rel_driven - The dimension rel_driven ((PRO_B_TRUE or PRO_B_FALSE)).
Return Values:
PRO_TK_NO_ERROR - The function successfully retrieved the
information.
PRO_TK_GENERAL_ERROR - The data structure was not set.
*/
Thanks for your reply, but ProDimensionIsReldriven only tells the user which dimension is driven by the relation; we can't determine which parameters are driving it.
This was your question
Is it possible to obtain the dimension object driven by a parameter through the toolkit?
With this call I mentioned, you know the LHS of the expression. The right side may evaluated by a regular expression, because you may not have a single parameter on this side, or you may have a function as well, So your approach may require a lot of code because you need to evaluate any token. A single value is easy, because it will tell you everything about the reference
Yes, that's why I made this point — because I don't think analyzing each expression is a good method either. I hope there's a better solution that I haven't found yet...😂
You could check ProRelset.h as well.
ProError ProRelsetConstraintsGet (ProRelset *relset,
wchar_t ***constraints);
/*
Purpose: Obtains the constraints applied to a given relation set.
Constraints may be assigned when one or more parameters of the set is
governed by an external parameter file. They act as read-only
relations.
Input Arguments:
relset - The relation set.
Output Arguments:
constraints - ProArray of constraints assigned to the parameters in the
given relation set.
Return Values:
PRO_TK_NO_ERROR - The function succeeded.
PRO_TK_BAD_INPUTS - One or more input arguments was invalid.
*/
Thank you for your help. However, it seems that the ProRelsetConstraintsGet function cannot find the object driven by the parameter or what drives it.😂
I'm a bit curious. Did PTC develop the "reference view" function using existing API interfaces?🙄