Positional Representations: Find out which constraints are impacted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to identify constraints that are overridden by a positional representation, but for the life of me can't figure out how to do so in C#.
So far i get a constraint and then start iterating all positional representations. For every positional representation I try to use the function IsRelationshipValueOverridden, which i think should give me true or false, whether the constraint is altered by the positional representation or not.
Sounds good so far, except for the IsRelationshipValueOverridden function wanting me to provide the correct RelationshipValueType (here: type):
myResult = myPosRep.IsRelationshipValueOverridden(constraint, type, out myExpr);
How can I know, what type to give here? I have tried many combinations but there is always a constraint that will fail with: Exception thrown: 'System.ArgumentException' in System.Dynamic.dll.
I even iterate through all types and try/catch to process it, but that can't be the solution (and still fails).
Thank you so much for the help!
foreach (var type in Inventor.RelationshipValueTypeEnum.GetValues(typeof(Inventor.RelationshipValueTypeEnum)).Cast<Inventor.RelationshipValueTypeEnum>()) { Inventor.RelationshipValueTypeEnum type = (Inventor.RelationshipValueTypeEnum)myType; //Console.WriteLine("Trying type: " + type.ToString()); try { myResult = myPosRep.IsRelationshipValueOverridden(constraint, type, out myExpr);