Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found this code in a previous post concerning Automatically show reference plans in drawing views and it works for what it was wrote for. But I would like to go down to the next level where I have two sub assemblies and turn on the reference planes at that level. Can anyone tell me or give me a direction of what needs to change to do that?
Thank you in advance.
Dim oDwgDoc As DrawingDocument Set oDwgDoc = ThisApplication.ActiveDocument Dim oSht As Sheet Set oSht = oDwgDoc.ActiveSheet Dim oDwgView As DrawingView Set oDwgView = ThisApplication.CommandManager.Pick(kDrawingViewFilter, "Select view to show the origin plane") Dim oWP As WorkPlane If oDwgView.ReferencedDocumentDescriptor.ReferencedDocumentType = kPartDocumentObject Then Dim oPartDoc As PartDocument Set oPartDoc = oDwgView.ReferencedDocumentDescriptor.ReferencedDocument Dim oPartCompDef As PartComponentDefinition Set oPartCompDef = oPartDoc.ComponentDefinition For Each oWP In oPartCompDef.WorkPlanes oWP.AutoResize = True On Error Resume Next Call oDwgView.SetIncludeStatus(oWP, True) Next Else Dim oAssyDoc As AssemblyDocument Set oAssyDoc = oDwgView.ReferencedDocumentDescriptor.ReferencedDocument Dim oAssyCompDef As AssemblyComponentDefinition Set oAssyCompDef = oAssyDoc.ComponentDefinition For Each oWP In oAssyCompDef.WorkPlanes oWP.AutoResize = True On Error Resume Next Call oDwgView.SetIncludeStatus(oWP, True) Next End If
Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Solved! Go to Solution.