Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

geometricConstraints.addCoincident error

Message 1 of 3
241 Views, 2 Replies

geometricConstraints.addCoincident error

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.

Message 2 of 3
in reply to: lorraine5RWGT

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
Message 3 of 3
in reply to: BrianEkins

Thanks!  That was very helpful!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th

Autodesk Design & Make Report