Message 1 of 16
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I have a iLogic I made to hide all plans in current assembly, or current part.
I want to be able to run it in a assembly, and run it in all subassemblies and parts.
I want to hide all plans.
What should I change to be able to run it recursively?
Thanks in advance!
Sub Main () Select Case ThisApplication.ActiveDocument.DocumentType Case kPartDocumentObject 'Part = kAssemblyDocumentObject = 12290 For Each oWorkPlane In ThisDoc.Document.ComponentDefinition.WorkPlanes Select Case oWorkPlane.Name Case "YZ Plane - RIGHT", "XZ Plane - TOP", "XY Plane - FRONT" Case "YZ Plane" oWorkPlane.Name = "YZ Plane - RIGHT" Case "XZ Plane" oWorkPlane.Name = "XZ Plane - TOP" Case "XY Plane" oWorkPlane.Name = "XY Plane - FRONT" Case Else 'MessageBox.Show("Planos não encontrados", "Planos") End Select oWorkPlane.Visible = False Next Case kAssemblyDocumentObject 'Assembly = kAssemblyDocumentObject = 12291 Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument For Each oWorkPlane In oAsmDoc.ComponentDefinition.WorkPlanes Select Case oWorkPlane.Name Case "YZ Plane - RIGHT", "XZ Plane - TOP", "XY Plane - FRONT" Case "YZ Plane" oWorkPlane.Name = "YZ Plane - RIGHT" Case "XZ Plane" oWorkPlane.Name = "XZ Plane - TOP" Case "XY Plane" oWorkPlane.Name = "XY Plane - FRONT" Case Else 'MessageBox.Show("Planos não encontrados", "Planos") End Select oWorkPlane.Visible = False oWorkPlane.AutoResize = True Next Case kDrawingDocumentObject 'Drawing = kDrawingDocumentObject = 12292 End Select End Sub
Solved! Go to Solution.