Hide and Show Sketches Example (VBA)
This example shows how to hide and show sketches in a model.
'---------------------------------------
'
' Preconditions:
' (1)
Model document is open.
' (2)
Sketches you want to hide are selected in either
' the
FeatureManager design tree or in the graphics area.
' (3)
After hiding the selected sketches, select the same sketches
' in
the FeatureManager design tree and continue to show them.
'
' Postconditions: None
'
'--------------------------------------
Option Explicit
Sub main()
Dim
swApp As
SldWorks.SldWorks
Dim
swModel As
SldWorks.ModelDoc2
Dim
bRet As
Boolean
Set
swApp = CreateObject("SldWorks.Application")
Set
swModel = swApp.ActiveDoc
'
Select the sketches in either the FeatureManager design tree
'
or the graphics area and hide them
swModel.BlankSketch
Stop
' Step over
'
Select the now hidden sketches in the FeatureManager
'
design tree and show them
swModel.UnblankSketch
End Sub
'---------------------------------------