- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have been trying to get this right but seem to have run into a brick wall. Please see an image of a sketch with some geometry below. Basically two concentric circles and two line segments.
I am trying to extrude the region indicated by the arrow. Here is what I have so far:
Dim oPartDoc As PartDocument = oApp.ActiveDocument
Dim oCompdef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oSketch As PlanarSketch = oCompdef.Sketches.Item(1)
Dim oProfile As Profile
If oSketch.Profiles.Count = 0 Then
oProfile = oSketch.Profiles.AddForSolid()
Else
oProfile = oSketch.Profiles.Item(1)
End If
Dim oProfileEntity As ProfileEntity
Dim oDeleteProfile As Boolean
For Each oProfilePath As ProfilePath In oProfile
oDeleteProfile = True
For Each oProfileEntity In oProfilePath
If oProfileEntity.CurveType = Curve2dTypeEnum.kLineSegmentCurve2d Then
oDeleteProfile = False
End If
Next
If oDeleteProfile Then
oProfilePath.Delete()
End If
Next
Dim oExtrudeDef As ExtrudeDefinition
oExtrudeDef = oCompdef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, PartFeatureOperationEnum.kJoinOperation)
oExtrudeDef.SetDistanceExtent(1, PartFeatureExtentDirectionEnum.kNegativeExtentDirection)
Dim oExtrude As ExtrudeFeature
oExtrude = oCompdef.Features.ExtrudeFeatures.Add(oExtrudeDef)
As you can see its not what I want.
Any idea as to how I can specify the correct area to extrude?
Thanks!
Solved! Go to Solution.