09-16-2024
11:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
09-16-2024
11:11 AM
@bradeneuropeArthur , as @WCrihfield mentioned, as far as I know we can't switch the sketch...
but we can delete and recreate the extrusion
hope this helps,
Curtis
example:
Dim oPartDoc As PartDocument oPartDoc = ThisDoc.Document Dim oCompDef As PartComponentDefinition oCompDef = oPartDoc.ComponentDefinition Dim oSketch As PlanarSketch oSketch = oCompDef.Sketches.Item("Sketch2") ' Create a profile. Dim oProfile As Profile oProfile = oSketch.Profiles.AddForSolid sName = "Extrusion1" Dim oExtrude As ExtrudeFeature oExtrude = oCompDef.Features.ExtrudeFeatures.Item(sName) oExtrude.Delete Dim oExtrudeDef As ExtrudeDefinition oExtrudeDef = oCompDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kJoinOperation) Call oExtrudeDef.SetDistanceExtent(4, kPositiveExtentDirection) oExtrude = oCompDef.Features.ExtrudeFeatures.Add(oExtrudeDef) oExtrude.Definition.Profile = oProfile oExtrude.Name = sName