Feature mirror error

Feature mirror error

Mehmet_Fatih_Turker
Advocate Advocate
79 Views
0 Replies
Message 1 of 1

Feature mirror error

Mehmet_Fatih_Turker
Advocate
Advocate

Hi all, 
Im at quite interesting stage for my project. I've never tried to mirror the feature or sketch and seems like some of coders are strugling here.

https://forums.autodesk.com/t5/inventor-programming-ilogic/assembly-circular-pattern-mirror-of-hole-...

 

https://forums.autodesk.com/t5/inventor-programming-ilogic/patterns-in-planar-sketches/td-p/12701116

 

 

I tried to keep as simple as possible in order to explain what is going on. Basically Im creating extrusion feature (that is working well), Defining mirror plane as XZ(item(2)) plane works well.
Then I can confirm that object collection is able to collect an extrude feature named as "ChamferandHoleExtrusion". Seems like MirrorFeatureDefinition is also created without problem but in debug mode, Program gives error at the line where AddByDefinition() method is used. I think this is the problem comes from Inventor itself and havent had solved yet. Does anyone know any workaround or help me correcting the code if I made mistake here ?

//some codes here 

                Dim chamferandHoleExtrusionDef As ExtrudeDefinition = upandDownLegPartCompDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(SketcforChamfering.Profiles.AddForSolid(), PartFeatureOperationEnum.kCutOperation)
                chamferandHoleExtrusionDef.SetThroughAllExtent(PartFeatureExtentDirectionEnum.kSymmetricExtentDirection)
                Dim chamferandHoleExtrudeFeature As ExtrudeFeature = upandDownLegPartCompDef.Features.ExtrudeFeatures.Add(chamferandHoleExtrusionDef)
                chamferandHoleExtrudeFeature.Name = "ChamferandHoleExtrusion"

                Dim mirrorPlane As WorkPlane = upandDownLegPartCompDef.WorkPlanes.Item(2)

                If mirrorPlane Is Nothing Then
                    Throw New Exception("The specified mirror plane does not exist.")
                End If

                Dim extrusionCollection As ObjectCollection = g_inventorApplication.TransientObjects.CreateObjectCollection
                extrusionCollection.Add(chamferandHoleExtrudeFeature)

                For Each item As Object In extrusionCollection
                    If TypeOf item Is ExtrudeFeature Then
                        Dim extrudeFeature As ExtrudeFeature = CType(item, ExtrudeFeature)
                        MsgBox("Item in collection is an ExtrudeFeature: " & extrudeFeature.Name)
                    Else
                        MsgBox("Unexpected item type: " & TypeName(item))
                    End If
                Next

                Dim mirrorDef As MirrorFeatureDefinition = upandDownLegPartCompDef.Features.MirrorFeatures.CreateDefinition(extrusionCollection, mirrorPlane)
                Dim mirrorFeature As MirrorFeatures = upandDownLegPartCompDef.Features.MirrorFeatures.AddByDefinition(mirrorDef)

 

 


An unexpected error occurred: Belirtilmemiş hata (Exception from HRESULT: 0x80004005 (E_FAIL))

Error am getting.

0 Likes
80 Views
0 Replies
Replies (0)