Hi,
I really need help on that, I'm completely stuck.
In assembly, when I add constraint between EdgeProxy and WorkPointProxy, by default, it use the axis of the edge but I want to use the center point.
When I try this command:
doc.ComponentDefinition.Constraints.AddMateConstraint(oEdgeProxy, oWorkPointProxy, 0, InferredTypeEnum.kInferredPoint)
I got an ArgumentException (in .NET).
Something I missing??
Thanks,
Pascal
Solved! Go to Solution.
Solved by TerryWen. Go to Solution.
Update:
It's works when the CurveType of the edge is kCircleCurve but not when is kEllipseFullCurve.
Someone know whY?
Pascal
Because kEllipseFullCurve edge can't be inferred as point. but you can try to create a work point at the center of the ellipse and then use it to create a constraint.
Hi Terry,
Do you mean: can't be inferred as point programmatically? Because I can do it manually in Inventor.
Look at the attachment. I did the constraint manually and add watch in Visual Studio.
EntityOne.CurveType = 5126 (kEllipseFullCurve)
EntityOneInferredType = 24835 (Point)
Edge.CurveType = kEllipseFullCircle [5126]
Edge.Type = kEdgeProxyObject
It suggests to me that is possible by programming !?
Is it possible to create a WorkPointProxy without a permanent WorkPoint in the part?
Pascal
Pascal,
Currently ellipse can't be inferred as point through API. And you can't get work point proxy without a work point in the part document.
A workaround is to create a work point in the part document, and then use its proxy in the assembly to create the mate constraint. you can create a planar sketch on the plane where the ellipse edge is in the part, and project the ellipse edge (it's usually done automatically), the center point of the ellipse will be created. So you can create a work point based on the sketch point of the ellipse center.
-terry
Terry,
Thank you for your answer.
I'll look for another workaround to do constraint because it's impossible to me to change a content center part without affecting old assembly document.
Pascal