SetToFaceExtent does not seem to work for HoleFeature

By Philippe Leefsma

Q:

When I try to use SetToFaceExtent on a HoleFeature, then it keeps returning error. What shall I do?

A:

This is as designed. To set the Face – which is a BRep input – to the Hole Feature, the stop node has to be moved above the Hole Feature. This is required for any Feature edit that involves a BRep input. On moving the stop node above the Hole Feature the call to SetToFaceExtent succeeds even with a Face as input.

 

    Sub SetToFaceExtentTest(ByVal app As Inventor.Application)

        Try

            Dim doc As PartDocument = app.ActiveDocument

 

            Dim hf As HoleFeature = app.CommandManager.Pick(

                SelectionFilterEnum.kPartFeatureFilter,

                "Select hole feature:")

 

            If hf Is Nothing Then

                Return

            End If

 

            Dim face As Face = app.CommandManager.Pick(

                SelectionFilterEnum.kPartFacePlanarFilter,

                "Select planar face:")

 

            If face Is Nothing Then

                Return

            End If

 

            hf.SetEndOfPart(True)

            hf.SetToFaceExtent(face, True)

            doc.ComponentDefinition.SetEndOfPartToTopOrBottom(False)

 

        Catch ex As Exception

            MsgBox(ex.ToString())

        End Try

    End Sub

<

p style=”line-height: normal;margin: 0in 0in 0pt” class=”MsoNormal”> 


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading