How to use MirrorFeatures.add to create Multi-body

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi ,all
I need help,thanks
I have the following code,but it creates feature ,not multi-body
<code>
Public Sub Mirror()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, _
ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject))
' Set a reference to the component definition.
Dim oCompDef As PartComponentDefinition
Set oCompDef = oPartDoc.ComponentDefinition
' Create a new sketch on the X-Y work plane.
Dim oSketch As PlanarSketch
Set oSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes(3))
' Set a reference to the transient geometry object.
Dim oTransGeom As TransientGeometry
Set oTransGeom = ThisApplication.TransientGeometry
' Draw a rectangle
Dim oRectangleLines As SketchEntitiesEnumerator
Set oRectangleLines = oSketch.SketchLines.AddAsTwoPointRectangle( _
oTransGeom.CreatePoint2d(-1, 0), _
oTransGeom.CreatePoint2d(-4, -3))
' Create a profile.
Dim oProfile As Profile
Set oProfile = oSketch.Profiles.AddForSolid
' Create a base extrusion 1cm thick.
Dim oExtrude As ExtrudeFeature
Set oExtrude = oCompDef.Features.ExtrudeFeatures.AddByDistanceExtent(oProfile, 1, kNegativeExtentDirection, kJoinOperation)
Dim oParentFeatures As ObjectCollection
Set oParentFeatures = ThisApplication.TransientObjects.CreateObjectCollection
oParentFeatures.Add oExtrude
Dim oYZPlane As WorkPlane
Set oYZPlane = oCompDef.WorkPlanes.Item(1)
Dim oMirror As MirrorFeature
Set oMirror = oCompDef.Features.MirrorFeatures.Add(oParentFeatures, oYZPlane)
End Sub
<code end>