- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Inventor 2022 Build 153
I am trying to set up an Extrusion that only affects a single body in a multi solid body part. I am clearing the affectedBodies collection then adding the body I want to use. However no matter which body is being added, the extrude feature always affects the same body. I notice while watching my locals window that the count for the affectedbodies under the extrude definition is always 0 even before I clear the collection. The collection count remains at 0 after the .add line as well...
I noticed in the admapi info for the ExtrudeDefinition.AffectedBodies property it says...
"If this property is not set for multi-body parts, the default solid body is used as the affected body." How do I go about setting the property for multibody?
What else should I be looking at?
What am I missing?
'Build the extrude definition
Dim NEExt As ExtrudeDefinition = PCdef.Features.ExtrudeFeatures.CreateExtrudeDefinition(JT.JointProfile, MyOp)
If JT.JointFlipped = True Then 'Check joint direction and set extrusion direction and affected body.
MyDir = PartFeatureExtentDirectionEnum.kPositiveExtentDirection
MyBod = PCdef.SurfaceBodies(PCdef.SurfaceBodies.Count)
Else
MyDir = PartFeatureExtentDirectionEnum.kNegativeExtentDirection
MyBod = PCdef.SurfaceBodies(PCdef.SurfaceBodies.Count - 1)
End If
Debug.Print(MyBod.Name)
NEExt.SetDistanceExtent(TubeUOM.ConvertUnits(Abs(JT.JointModNonExpEnd), TubeUOMEnum, UnitsTypeEnum.kCentimeterLengthUnits), MyDir)
NEExt.AffectedBodies.Clear() 'Clear the bodies collection
NEExt.AffectedBodies.Add(MyBod) 'Set the affected body
PCdef.Features.ExtrudeFeatures.Add(NEExt) 'Create the feature
Solved! Go to Solution.