geometricConstraints.addCoincident error

geometricConstraints.addCoincident error

lorraine5RWGT
Enthusiast Enthusiast
589 Views
2 Replies
Message 1 of 3

geometricConstraints.addCoincident error

lorraine5RWGT
Enthusiast
Enthusiast

I'm trying to add a coincidentConstraint between the endpoint of a sketchFittedSpline and the endpoint of a sketchLine, but I keep getting this error.  Does anyone know what this error means?

 

(Pdb) cornerSketch.geometricConstraints.addCoincident(line.startSketchPoint, controlPtSpline.startSketchPoint)
*** RuntimeError: 2 : InternalValidationError : sketch == msketch

`line` is a sketchLine in `cornerSketch` while `controlPtSpline` is a sketchFittedSpline in another sketch.  Is it possibly producing the error because they are in different sketches?   I am able to add a coincidentConstraint between the endpoints of sketchCurves from different sketches when working in the Fusion GUI, though.

0 Likes
Accepted solutions (1)
590 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor
Accepted solution

Constraints can only be applied between geometry in the same sketch.  The reason it appears to work in the UI is that the coincident constraint command is doing some extra work in the background.  It's including the sketch point from the other sketch into the other sketch.  This essentially creates a new sketch point that is associatively linked to the existing sketch point.  By doing that you now have a point in the sketch and a coincident constraint can be added.  You can do the same thing in the API by using the Sketch.include method.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 3

lorraine5RWGT
Enthusiast
Enthusiast

Thanks!  That was very helpful!

0 Likes