- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In my script creatplane.py on github at https://github.com/erkooi/fusion360/blob/main/README.md I get an error in Fusuin360 when I use setByThreePoints() to create a plane. It seems as if some coordinates have too many decimals, because when I reduce the number of decimals in one or more of them, then the plane can be created.
I reproduced the issue in the Sample script "Construction Plane API Sample" at https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-c4edd2d2-aea3-11e5-98bc-f8b156d7cd97 and changed the default coordinates to ones with many decimals:
# Create three sketch points
sketchPoints = sketch.sketchPoints
positionOne = adsk.core.Point3D.create(-143, 41, 0)
sketchPointOne = sketchPoints.add(positionOne)
positionTwo = adsk.core.Point3D.create(-49.2778148942438, 75.8733712021419, 0)
sketchPointTwo = sketchPoints.add(positionTwo)
positionThree = adsk.core.Point3D.create(-236.722185105756, 6.12662879785814, 0)
sketchPointThree = sketchPoints.add(positionThree)
and then I get this error in Fusion360:
Failed:
Traceback (most recent call last):
File "D:/git/fusion360/API/Scripts/ConstructionPlaneApiSample/ConstructionPlaneApiSample.py", line 100, in run
planes.add(planeInput)
File "C:\Users/Gebruiker/AppData/Local/Autodesk/webdeploy/production/b0c303e70bd97cfdc195adab65922cfeffcb363a/Api/Python/packages\adsk\fusion.py", line 15970, in add
return _fusion.ConstructionPlanes_add(self, input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 2 : InternalValidationError : data_->execute(&obj, apiName) && obj
Can you please help me with this ?
Solved! Go to Solution.