Message 1 of 4
Mirror body rule, how to mirror all bodies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi
i found a rule for mirroring bodies in a part
i modified it a bit to suit what i want to do with it
could you guys help me out. the rule is only mirroring the last solid body
its counting the no of solids but using that number as the body to mirror
how would one get it select all solids in the part?
oFile = ThisDoc.PathAndFileName(False) 'Save a copy of the file ThisDoc.Document.SaveAs(oFile + "_Mirror" + ".ipt", False) 'Count the Solid bodies in the part file oFile3 = ThisApplication.ActiveDocument oSolidBodyCounter = oFile3.ComponentDefinition.SurfaceBodies.Count Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim oCol As ObjectCollection oCol = ThisApplication.TransientObjects.CreateObjectCollection oCol.Add (oDoc.ComponentDefinition.SurfaceBodies(oSolidBodyCounter)) Dim oPlane As WorkPlane oPlane = oDoc.ComponentDefinition.WorkPlanes(1) Dim oMirror As MirrorFeature oMirror = oDoc.ComponentDefinition.Features.MirrorFeatures.Add(oCol, oPlane, True, kOptimizedCompute) 'Save the new Mirrored Part File ThisDoc.Document.Save MessageBox.Show("the model has been mirrored", "mirrored")