Create GTol Composite Frame Example (VBA)
This example shows how to create a composite frame for a geometric tolerance
symbol.
'---------------------------------------------------------------------------
' Preconditions:
' 1. Open a document with a geometric tolerance (GTol) whose first two
' frames have the same symbol.
' 2. Select the GTol in the graphics area.
' 3. Open an Immediate window.
'
' Postconditions: A composite frame for the symbol is created in the graphics area.
'----------------------------------------------------------------------------
Dim swApp As SldWorks.SldWorks
Dim selMgr As SldWorks.SelectionMgr
Dim Part As SldWorks.ModelDoc2
Dim gtol As SldWorks.gtol
Option Explicit
Sub main()
Set swApp = _
Application.SldWorks
Set Part = swApp.ActiveDoc
Set selMgr = Part.SelectionManager
Set gtol = selMgr.GetSelectedObject6(1, -1)
gtol.SetCompositeFrame2 True, 1
Debug.Print "Frame 1 is part of a GTol composite frame? " &
gtol.GetCompositeFrame2(1)
End Sub