Exception in running Plane.intersectWithSurface

Exception in running Plane.intersectWithSurface

nnikbin
Collaborator Collaborator
1,246 Views
6 Replies
Message 1 of 7

Exception in running Plane.intersectWithSurface

nnikbin
Collaborator
Collaborator

When I run the following code:

 

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        origin = adsk.core.Point3D.create(0, 0, 0)
        sphere = adsk.core.Sphere.create(origin, 50)
		
        normal = adsk.core.Vector3D.create(0, 1, 0)
        plane = adsk.core.Plane.create(origin, normal)

        intersections = plane.intersectWithSurface(sphere)
        
        if intersections is None:
            ui.messageBox("No Intersections")
        elif intersections.count > 0:
            ui.messageBox("Intersects!")
        
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

I get the following exception at this line:

 

intersections = plane.intersectWithSurface(sphere)

 

Error_01.png

 

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "C:/Users/Navid/AppData/Local/Autodesk/webdeploy/production/4985426b59f0976109b4ac17335cfe5e17f5b1cf/Api/Python/packages\adsk\core.py", line 18309, in intersectWithSurface

return _core.Plane_intersectWithSurface(self, *args)

RuntimeError: 2 : InternalValidationError : err == AcGe::kXXOk

 

How can I fix it?

0 Likes
Accepted solutions (1)
1,247 Views
6 Replies
Replies (6)
Message 2 of 7

KrisKaplan
Autodesk
Autodesk
Accepted solution

Unfortunately, it looks like there is a missing dependency in the implementation of Plane.intersectWithSurface API.  There would be nothing you could do to fix this in your script.  I filed a defect on this, and we will hopefully get it fixed for the next update.

 

Kris



Kris Kaplan
0 Likes
Message 3 of 7

nnikbin
Collaborator
Collaborator

Hi Kris,

 

Thank you for your response.

Do you have any idea about the release date of the next update?

 

Regards,

Navid

0 Likes
Message 4 of 7

KrisKaplan
Autodesk
Autodesk

The next major update that this would likely be in is currently scheduled for the later half of January.

 

Kris



Kris Kaplan
0 Likes
Message 5 of 7

nnikbin
Collaborator
Collaborator

Thanks Kris

0 Likes
Message 6 of 7

liujac
Alumni
Alumni

This issue has been fixed. The fix will be included in the coming update.

 

Thanks,

Jack

0 Likes
Message 7 of 7

nnikbin
Collaborator
Collaborator
Thanks Jack,
Hope to get the update soon
0 Likes