trying to mirror the component though a plane like a picturebelow. Then I want to mirror like the next picture
and the I record macro using Insert>>Mirror Componentcommand. The code that I recorded are:
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Part.MirrorSubAssembly
boolstatus = Part.Extension.SelectByID2("Right Plane", "PLANE", 0,0, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Hinge-1@Assem2","COMPONENT", -0.1267148684469, 0.05833566363731, -0.01904039532695,True, 0, Nothing, 0)
boolstatus = Part.EditRebuild3
Part.ClearSelection2 True
End Sub
When i run this macro again it's don't working. Can anyone tell mewhere i modify this code for it's working?
Thanks,
Shukree
SolidworksApi macros


and the I record macro using Insert>>Mirror Componentcommand. The code that I recorded are:
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Part.MirrorSubAssembly
boolstatus = Part.Extension.SelectByID2("Right Plane", "PLANE", 0,0, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Hinge-1@Assem2","COMPONENT", -0.1267148684469, 0.05833566363731, -0.01904039532695,True, 0, Nothing, 0)
boolstatus = Part.EditRebuild3
Part.ClearSelection2 True
End Sub
When i run this macro again it's don't working. Can anyone tell mewhere i modify this code for it's working?
Thanks,
Shukree
SolidworksApi macros