Community
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.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Runtime Error 5: Path is tangent to profile When Extruding rotated Component

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
nnamfoh
3761 Views, 2 Replies

Runtime Error 5: Path is tangent to profile When Extruding rotated Component

I'm trying to extrude from a sketch that belongs to a component that has a non-standard origin

The origin has the y and z axes switched and is translated <1,1,1>. This is shown in the figure below.

 

I'm using this code to create the extrusion and get the error posted below:

boltComp = self.RWO
        boltSketches = boltComp.sketches
#        reportMessageBox("building bolt", ("random"))
        xyPlane = boltComp.xYConstructionPlane
        planes = boltComp.constructionPlanes
        planeInput = planes.createInput()
        #offset plane example
        offsetValue = adsk.core.ValueInput.createByReal(0);
        planeInput.setByOffset(xyPlane, offsetValue)
        plane = planes.add(planeInput)
        sketch = boltSketches.add(plane)    
        center = boltComp.originConstructionPoint.geometry
        vertices = []
        for i in range(0, 6):
            vertex = adsk.core.Point3D.create(center.x + (self.hDiameter/2) * math.cos(math.pi * i / 3), center.y + (self.hDiameter/2) * math.sin(math.pi * i / 3),0)
            vertices.append(vertex)
        for i in range(0, 6):
            sketch.sketchCurves.sketchLines.addByTwoPoints(vertices[(i+1) %6], vertices[i])
        extrudes = boltComp.features.extrudeFeatures
        prof = sketch.profiles[0]
        extInput = extrudes.createInput(prof, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
        distance = adsk.core.ValueInput.createByReal(self.hHeight)
        extInput.setDistanceExtent(True, distance)
        headExt = extrudes.add(extInput)

cpature.PNGerror.PNG

2 REPLIES 2
Message 2 of 3
ekinsb
in reply to: nnamfoh

I'm able to reproduce the problem you've reported.  It's a bug in the API.  I've reported it so we can work on fixing it.  It's specific to the orientation of your occurrence.  When I first tested it it was working ok but I had an arbitrary orienation for my occurrence and when I repositioned to the orientation you described the problem occurred.  I actually found another problem too where the construction plane being created is not oriented correctly.  We'll get that fixed too.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 3
nnamfoh
in reply to: nnamfoh

A temporary solution that worked for me was to only rotate the component after fully creating the design. This problem was specific to the orientation but the extrusion was always angled relative to the document space rather than the component.

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