derived configurations: how to find out which ones in the tree drive a given parameter

Programming and macros
Kjara
Posts: 21
Joined: Mon Jul 19, 2021 2:49 am
Answers: 0
x 1

derived configurations: how to find out which ones in the tree drive a given parameter

Unread post by Kjara »

I have a configuration tree with top-level configuration(s) and derived configuration(s), arbitrarily nested.
For a given configuration (of any level) and a given parameter, I want to find out which configurations in the tree (root = given configuration) control the parameter.

How do I do that?

Note: There is not necessarily a design table present.


Clarification example:

Assume the following configuration tree (here just a chain):

A (top)
- A1 (derived from A)
-- A2 (derived from A1)

Assume the given IConfiguration object is A and the given parameter is the dimension D1@Sketch1.

There are 4 possibilities:
1. A and A1 and A2 control D1@Sketch1. (A1 overwrites A and A2 overwrites A1.)
2. A and A1 control D1@Sketch1. (A1 overwrites A.)
3. A and A2 control D1@Sketch1. (A2 overwrites A.)
4. A controls D1@Sketch1. (No overwrite.)

To clarify why I need this:

In my program/macro, I have to set a given parameter (like the dimension D1@Sketch1) to a given value (like 50) for a given configuration (like A) so that it affects the whole configuration tree, but so that I do not break or create any links of derived configurations below the given configuration.

So in case 4 I would only set the parameter for A. In case 3 I would set it for both A and A2. In case 1 I would set it for A and A1 and A2.
Kjara
Posts: 21
Joined: Mon Jul 19, 2021 2:49 am
Answers: 0
x 1

Re: derived configurations: how to find out which ones in the tree drive a given parameter

Unread post by Kjara »

It seems that using IConfiguration.GetParameters or IModelDoc2.GetConfigurationParams returns a list of parameters, which I can then check for the presence of my given parameter. If it is present, I know it is controlled in the configuration, and vice versa.

However, the API helps says for both methods
The output values may not be accurate if a design table was not added to the model.
, so I am wondering how to make sure that I get up-to-date information even if there is no design table?
Post Reply