switch each component alignment to get what I want.
Each component is aligned in this way automatically by SW like this without user interaction.
According to:
https://help.solidworks.com/2024/Englis ... eData.html
I tried to use the minimum conditions and the alignment of every component defaults to the same value, as per documentation. So the mirror came out in a different way.To create a basic Mirror Component feature, use at a minimum:
・IMirrorComponentFeatureData::MirrorPlane
・IMirrorComponentFeatureData::ComponentsToInstanceAlignToComponentOrigin
・(Optional) IMirrorComponentFeatureData::MirrorType (if not explicitly set, defaults to swMirrorComponentMirrorType_e.swMirrorType_CenterOfBoundingBox)
・(Optional) IMirrorComponentFeatureData::ComponentOrientationsAlignToComponentOrigin (if not explicitly set, defaults to swMirrorComponentOrientation2_e.swOrientation_MirroredX_MirroredY)
To create a mirror instance as a copy of the component, positioned symmetrically about a plane in one of four orientations (for fully symmetric components, all four orientations are true mirrors), use:
・MirrorPlane
・MirrorType
・ComponentOrientationsAlignToComponentOrigin
・ComponentOrientationsAlignToSelection
・ComponentsToInstanceAlignToComponentOrigin
・ComponentsToInstanceAlignToSelection
・AlignmentReferences
・FlipDirections
・SyncFlexibleSubAssemblies
Code: Select all
swMirroCompFeatData.mirrorPlane = mirrorPlane
swMirroCompFeatData.ComponentsToInstanceAlignToComponentOrigin = compsToInstance
swMirroCompFeatData.MirrorType = swMirrorType_CenterOfBoundingBox
' Specify align to origins component orientations (I tried to skip this)
'swMirroCompFeatData.ComponentOrientationsAlignToComponentOrigin = swOrientation_MirroredX_MirroredAndFlippedY
' Create MirrorComponent
Set swFeat = swFeatMgr.CreateFeature(swMirroCompFeatData)