Sub Gewinde() Dim oPartDoc As PartDocument Set oPartDoc = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition Set oCompDef = oPartDoc.ComponentDefinition Dim oThreadFeatures As ThreadFeatures Set oThreadFeatures = oCompDef.Features.ThreadFeatures Dim oHole As Inventor.HoleFeature For Each oHole In oPartDoc.ComponentDefinition.Features.HoleFeatures If TypeOf oHole Is Inventor.HoleFeature Then If oHole.Name = "Loch" Then Dim oSize As Double If oHole.HoleDiameter.Value = "1" Then oSize = "M10x1,5" End If If oHole.HoleDiameter.Value = "1,2" Then oSize = "M12x1,75" End If If oHole.HoleDiameter.Value = "1,6" Then oSize = "M16x2" End If End If End If Next Dim oThreadInfo As ThreadInfo Set oThreadInfo = oThreadFeatures.CreateStandardThreadInfo( _ False, True, "ANSI Metrisches M Pofil", _ oSize, "6g") Dim oExtrude As Inventor.ExtrudeFeature Set oExtrude.Name = "Würfel" Dim oFace As Face Set oFace = oExtrude.EndFaces.Item(1) Dim oEdge As Edge Set oEdge = oExtrude.EndFaces.Item(1).Edges.Item(1) Dim oThreadFeature As ThreadFeature Set oThreadFeature = oThreadFeatures.Add(oFace, oEdge, oThreadInfo, _ False, False, "2 cm", 0) End Sub