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

BUG in mirroring features?

Message 1 of 1
130 Views, 0 Replies

BUG in mirroring features?



How do I get someone in AD to take the issue of hole features seriously?  I've reported similar issues with creating hole features several times before but nothing has been done about it.  bug reported hereother bugs reported hereand here


It is clear, at least to me, that the process of mirroring a component is flawed, and severely flawed when it comes to holes features.  To demonstrate - I've created a simple script that adds a hole to a simple box component (just to make the script easier, I've limited the hole creation to a face that has 8 edges - ie one with a square hole in it).  The holes are supposed to be created at face.pointInFace.  In the attached screen cast you can see that holes in a normal component are created correctly, however holes created in the mirrored box actually end up on the wrong side of the mirroring plane.  This implies that the mirroring process does not mirror everything, and clearly leaves some internal coordinate aspects in the unmirrored state.


Not only is this a huge problem for me, but I strongly suspect that it is a source of model instability and unexplained crashes.


Screencast will be displayed here after you click Post.


To use the script - click on any vertex on a face with a hole in it.  A file with the model is attached.





import adsk.core, adsk.fusion, traceback

def run(context):
  ui = None
    app = adsk.core.Application.get()
    ui  = app.userInterface
    design = adsk.fusion.Design.cast(app.activeProduct)
    root = design.rootComponent
    def createHole(face:adsk.fusion.BRepFace, vertex):
        component = adsk.fusion.Component.cast(face.assemblyContext.component)
        occurrence = root.allOccurrencesByComponent(component).item(0) #make top/first occurrence 
#        Hole feature doesn't work consistently for any other occurrence except :1
        face = face.nativeObject.createForAssemblyContext(occurrence)
        vertex = vertex.nativeObject.createForAssemblyContext(occurrence)
        holes =  component.features.holeFeatures
        holeInput = holes.createSimpleInput(adsk.core.ValueInput.createByReal(.5*2.54))
        holeInput.isDefaultDirection = True
        holeInput.creationOccurrence = occurrence
        holeInput.tipAngle = adsk.core.ValueInput.createByString('180 deg')
        holeInput.participantBodies = [face.body]
        holeInput.setPositionByPoint(face, face.pointOnFace)


        return holes.add(holeInput)
    vertexSelection = ui.selectEntity('select a vertex', 'Vertices')
    vertex = vertexSelection.entity   
    for face in vertex.faces:
        if face.edges.count != 8:
        startFace = face
    occurrence = startFace.body.assemblyContext
    hole = createHole(startFace, vertex)

    if ui:



I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).

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