Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, is it possible to autorun this VBA code I've found from a 8 year old forum post whenever I open a part/assembly?
Public Sub TurnAllOff()
' Make sure a part of assembly is active.
If ThisApplication.ActiveDocumentType = kAssemblyDocumentObject Or _
ThisApplication.ActiveDocumentType = kPartDocumentObject Then
Dim doc As Document
Set doc = ThisApplication.ActiveDocument
Dim objVis As ObjectVisibility
Set objVis = doc.ObjectVisibility
objVis.AllWorkFeatures = False
objVis.Sketches = False
objVis.Sketches3D = False
Else
MsgBox "A part of assembly must be active."
End If
End Sub
Solved! Go to Solution.