Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello together,
I would like to select a hole and get the first element from an RectangularPattern or CircularPattern feature in part environment. How could I achieve this?
Dim m_inventorApp As Inventor.Application = Nothing m_inventorApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application") ' Get the selected face. On Error Resume Next Dim oFace As Face oFace = m_inventorApp.ActiveDocument.SelectSet.Item(1) ' Check to see if this face was created by an extrude, ' revolve, or hole feature. Dim oCreatedByFeature As PartFeature oCreatedByFeature = oFace.CreatedByFeature ' Get the associated sketch. Dim oSketch As PlanarSketch If TypeOf oCreatedByFeature Is HoleFeature Then Dim oHole As HoleFeature oHole = oCreatedByFeature MsgBox(oHole.Name) ElseIf TypeOf oCreatedByFeature Is RectangularPatternFeature Or TypeOf oCreatedByFeature Is CircularPatternFeature Then Dim oHole As HoleFeature On Error Resume Next oHole = oCreatedByFeature.ParentFeatures.Item(1) MsgBox(oHole.Name & " Circular or Rectangular Pattern") End If
Thank you
Georg
Solved! Go to Solution.