Programmatically Determine if Configuration is From Design Table
Programmatically Determine if Configuration is From Design Table
Is there a method via the API to determine if a configuration is controlled by a design table? I'm looking for something that doesn't involve activating the design table.
Re: Programmatically Determine if Configuration is From Design Table
I can't see where that's exposed in the API. It's obviously stored somewhere because the tree shows a different icon for DT controlled configs, but I don't see it anywhere.
- AlexLachance
- Posts: 2141
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2305
- x 1974
Re: Programmatically Determine if Configuration is From Design Table
Could you check for a code that loads the excel file..? I'm guessing that is stored inside the file and thus not a valid route.
Re: Programmatically Determine if Configuration is From Design Table
I'm going to show off my ignorance and ask a question I came to after trying to look into this. If I were using API to edit a model (not even considering configurations now), how would I determine if the value I'm changing is/was controlled by a design table?
My line of thought is the info in one/some the parameter(s) of the config rather than the config object itself? Llooking at GetParameters Method (IConfiguration) to get the parameters then check if the parameter is controlled by design table?
My line of thought is the info in one/some the parameter(s) of the config rather than the config object itself? Llooking at GetParameters Method (IConfiguration) to get the parameters then check if the parameter is controlled by design table?
Re: Programmatically Determine if Configuration is From Design Table
Good line of thought... The Dimension object does have an IsDesignTableDimension property. However, it appears to me (after an admittedly quite brief test) that this returns "True" if the dimension is controlled by the DT in any config, whether or not the currently active config is controlled by the DT. The dimension also shows the "controlled by DT" system color in the UI for configs. If you enable "Block model edits that would update the DT", trying to edit this dimension gives you the error message that it's controlled by the DT, although it then does allow you to change the value if the current config is not in the DT. If the current config is in the DT, the edit box never even comes up.
I can't see anything different in the values returned by GetParameters between DT and non-DT configs either.
It might be possible to set the DT properties to block model edits, then read the params, see which are DT controlled, then try to change a value and see if the change is successful or not. If the change is successful, this config is not in the DT. Of course, there are a number of other conditions that might make the change fail. Or it might be possible that this is a way to get around blocked model edits... I did find that it's possible in the UI to "specify configs" when editing a value while a non-DT config is active. I was able to change DT controlled dimensions in DT controlled configs even with model edits blocked using this method.
I can't see anything different in the values returned by GetParameters between DT and non-DT configs either.
It might be possible to set the DT properties to block model edits, then read the params, see which are DT controlled, then try to change a value and see if the change is successful or not. If the change is successful, this config is not in the DT. Of course, there are a number of other conditions that might make the change fail. Or it might be possible that this is a way to get around blocked model edits... I did find that it's possible in the UI to "specify configs" when editing a value while a non-DT config is active. I was able to change DT controlled dimensions in DT controlled configs even with model edits blocked using this method.
Re: Programmatically Determine if Configuration is From Design Table
SPR 289114 - Would like API to tell whether configuration is driven by Design Table
It's a relatively new SPR from July 2021.
It would be nice to have but it isn't essential for me, so I'll sign up to be notified if it is implemented and move on.
It's a relatively new SPR from July 2021.
It would be nice to have but it isn't essential for me, so I'll sign up to be notified if it is implemented and move on.