- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an addin where one component of it takes two projected edges that for a 90 degree corner, creates a third sketchline that is directly between those two edges using a symmetry constraint. 99% of the time this works just fine. However, under conditions that seem arbitrary, I get a "Failed : 5 : Sketch Gemoetry is over constrained" error when I try to apply the symmetry constraint.
Here is the section of code casuing problems:
Here are some screenshots of an example design where it sometimes fails:
The second image shows the created projected lines and the created line that is supposed to be symmetrical. However, the symmetry constraint fails and is not applied in the second image (the line is in the exact middle because my add-in constructs it that way, but it is unconstrained).
Several changes will cause the add-in and the symmetry constraint not to fail:
1) using the modify tool to change the geometry being projected in any way that changes the projected lines
2) increasing the dimensions of the gap to 21.5 or larger
Manually creating the symmetry constraint after the add-in fails succeeds and behaves as expected.
Below is the segment of code in question, a link to the github repo with the add-in and attached is the design I'm using to debug the problem. Does anyone have any idea what's happening here?
https://github.com/caseycrogers/Dogbone
tempPoint = adsk.core.Point3D.create((pointTuple[1].geometry.x + pointTuple[2].geometry.x)/2, (pointTuple[1].geometry.y + pointTuple[2].geometry.y)/2, 0) line0 = lines.addByTwoPoints(pointTuple[0], tempPoint) line0.isConstruction = True line1.isConstruction = True line2.isConstruction = True ui.messageBox("got here") constraints.addSymmetry(line1, line2, line0) ui.messageBox("this doesn't display because it crashes")
Solved! Go to Solution.