I'm seeing behaviour that I believe is odd.
Manual create sweep:
If I manually create a surface sweep using two sketches, the face IDs are in 'sequential order' meaning from one end to the other, they are items 1,2,3,4.
Using code to create sweep:
If I used code to create the sweep using the same sketch and features, the face IDs are not in 'sequential order'.
Below is an image calling out the sketch line IDs at the top and the surface face IDs at the bottom after built with code.
Below is the code that creates the sweep:
Dim oSketchColl as ObjectCollection
oSketchColl = ThisApplication.TransientObjects.CreateObjectCollection
For j = 1 to iSketchLineCount
oSketchColl.Add(oImportedSketch.SketchLines.Item(j))
Next j
Dim oSweepLine as SketchEntitiesEnumerator
oSweepLine = oImportedSketch.OffsetSketchEntitiesUsingDistance(oSketchColl, dOD, False, False, True)
Dim oSweepPath as Path
oSweepPath = oCompDef.Features.CreatePath(oSweepLine.Item(1))
Dim oSweepProfile as Profile
oSweepProfile = oSketches.Item("Sketch_1_Start").Profiles.AddForSurface(oSketches.Item("Sketch_1_Start").SketchArcs.Item(1))
Dim oSweepDef as SweepDefinition
oSweepDef = oCompDef.Features.SweepFeatures.CreateSweepDefinition(kPathSweepType, oSweepProfile, oSweepPath, kSurfaceOperation)
Dim oSweep As SweepFeature
oSweep = oCompDef.Features.SweepFeatures.Add(oSweepDef)
It's important that I keep the face IDs consistent as I'm addressing those faces later on.
Thanks,
Randy Mabery
Applications Expert
IMAGINiT Technologies