Given a selected GTOL frame, I need to determine the value of the DIM that the GTOL is attached to. It’s easy enough to get the properties of a GTOL frame, and I can determine if it’s attached to something, but getting the dimension itself is eluding me.
Dim swApp As SldWorks.SldWorks
Dim swDoc As SldWorks.ModelDoc2
Dim swAnn As SldWorks.Annotation
Dim vEnts As Variant
Dim swDisp As SldWorks.DisplayDimension
Dim swGtol As SldWorks.Gtol
Sub main()
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set swGtol = swDoc.SelectionManager.GetSelectedObject6(1, -1)
Set swAnn = swGtol.GetAnnotation
vEnts = swAnn.GetAttachedEntities3
Set swDisp = vEnts(0)
Debug.Print swDisp.GetDimension2(0).Value
End Sub