Change Width of FeatureManager Design Tree Example (VBA)
This example shows how to change the width of the FeatureManager design
tree.
'----------------------------------------
'
' Preconditions: Model document is open.
'
' Postconditions: Width of FeatureManager design tree
is doubled.
'
'----------------------------------------
Option Explicit
Sub main()
Dim
swApp As
SldWorks.SldWorks
Dim
swModel As
SldWorks.ModelDoc2
Dim
nWidth As
Long
Dim
NewWidth As
Long
Dim
nRetVal As
Long
Set
swApp = CreateObject("SldWorks.Application")
Set
swModel = swApp.ActiveDoc
nWidth
= swModel.GetFeatureManagerWidth
nRetVal
= swModel.SetFeatureManagerWidth(nWidth
* 2)
NewWidth
= nWidth * 2
Debug.Print
"File = " & swModel.GetPathName
Debug.Print
" Old
width = " & nWidth & " pixels"
Debug.Print
" New
width = " & NewWidth & " pixels"
End Sub
'----------------------------------------