Problem to add constraint between EdgeProxy and WorkPointProxy

Problem to add constraint between EdgeProxy and WorkPointProxy

Anonymous
Not applicable
934 Views
5 Replies
Message 1 of 6

Problem to add constraint between EdgeProxy and WorkPointProxy

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
935 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

Update:

 

It's works when the CurveType of the edge is kCircleCurve but not when is kEllipseFullCurve.  

 

Someone know whY?

 

Pascal

0 Likes
Message 3 of 6

TerryWen
Alumni
Alumni

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.

0 Likes
Message 4 of 6

Anonymous
Not applicable

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

0 Likes
Message 5 of 6

TerryWen
Alumni
Alumni
Accepted solution

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

0 Likes
Message 6 of 6

Anonymous
Not applicable

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

0 Likes