Okay, so in the end it was almost it.
selfRef.Parent is not a HybridShape but a SketchBasedShape (a Pad to be exact). To get the real type of the object I used IDisplatch.GetTypeInfo, then ITypeInfo.GetDocumentation, which gives the name of the real type.
Now I completely overlooked the fact...
Sure, here it is:
foreach (MECMOD.Constraint c in prod.Connections("CATIAConstraints"))
{
var elem1 = c.GetConstraintElement(1);
var path = elem1.DisplayName.Split('/').TakeWhile(x => !x.StartsWith("!"));
var current = prod.Application.Documents.OfType<ProductDocument>().First(x =>...
Seems to make sense.
However it still doesn't work.
I successfully get a reference when calling CreateReferenceFromName, but the call to GSMGetObjectFromReference fails with E_FAIL once again.
Hey,
thanks for your answer.
Sadly that doesn't work either. When enumerating constraints I'm in the context of the assembly, so not too sure how to get the part to get the HybridShapeFactory.
I tried on all the part in the assembly but all I get when calling GSMGetObjectFromReference is an...
Hello,
I'm currently struggling to access constraint references. I'm trying to find the object a reference is pointing to (see http://catiadoc.free.fr/online/interfaces/interface_Constraint.htm => GetConstraintElement).
Seems like the only usefull information in the reference object is...