I've modified the code to mirror the solid instead of the extrude feature.
Also, the original is not retained by setting the 3rd argument of
MirrorFeatures.Add to True.
Sanjay-
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 oCompDef.SurfaceBodies.Item(1)
Dim oYZPlane As WorkPlane
Set oYZPlane = oCompDef.WorkPlanes.Item(1)
Dim oMirror As MirrorFeature
Set oMirror = oCompDef.Features.MirrorFeatures.Add(oParentFeatures,
oYZPlane, True)
End Sub
wrote in message news:5015857@discussion.autodesk.com...
Thanks Sanjay. I still have a problem in that I wish to Mirror the entire
model.
I wish to have code that achieves the equivalent of the interative commands:
'Mirror Feature'
'Mirror the Entire Solid'
'Remove Original'
'Mirror Plane' & selecting the YZ Plane from the Origin
Hoping that you can help
Alistair