Intersection fails with: RuntimeError: 2 : InternalValidationError : face

Intersection fails with: RuntimeError: 2 : InternalValidationError : face

corbin2
Enthusiast Enthusiast
92 Views
0 Replies
Message 1 of 1

Intersection fails with: RuntimeError: 2 : InternalValidationError : face

corbin2
Enthusiast
Enthusiast

Hi! I have a paid subscription and I'm looking for support.

 

I have a plugin that is always giving "RuntimeError: 2 : InternalValidationError : face" with a specific input. It only gives this error when I do it in code; it works fine if I do it "by hand". I must be doing something wrong...but I can't figure it out.

 

Steps to reproduce:

1. Open the attached Fusion file (I can also give a simpler test case)

2. Run the attached TestSketch.py

 

The code isn't complex; it attempts to do a through all intersect with a single body:

 

        component = design.rootComponent
        sketch = component.sketches.itemByName('Letters')
        sketchText = sketch.sketchTexts[0]
        collection = ObjectCollection.create()
        collection.add(sketchText)
        targetBody = component.bRepBodies.itemByName('Body10')
        intersectInput = component.features.extrudeFeatures.createInput(collection, FeatureOperations.IntersectFeatureOperation)
        intersectInput.setTwoSidesExtent(ThroughAllExtentDefinition.create(), ThroughAllExtentDefinition.create()) # Catches all...
        intersectInput.participantBodies = [targetBody]

        result = component.features.extrudeFeatures.add(intersectInput)
        app.log('Success!')

 

It will fail with:

 

Failed:
Traceback (most recent call last):
File "/Users/corbin/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/TestSketch/TestSketch.py", line 35, in run
result = component.features.extrudeFeatures.add(intersectInput)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/corbin/Library/Application Support/Autodesk/webdeploy/production/30eb8ad5b2a1a68f916c8e17392184e2a9e0b8fc/Autodesk Fusion.app/Contents/Api/Python/packages/adsk/fusion.py", line 26770, in add
return _fusion.ExtrudeFeatures_add(self, input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 2 : InternalValidationError : face

 

I would love any advice on how to work around this issue!

 

Thanks,

Corbin

 

0 Likes
93 Views
0 Replies
Replies (0)