Need to determine the value of DIM with attached GTOL

Programming and macros
User avatar
loeb
Posts: 69
Joined: Sun Jan 16, 2022 5:55 pm
Answers: 1
x 39
x 10

Need to determine the value of DIM with attached GTOL

Unread post by loeb »

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.

Thanks,
User avatar
josh
Posts: 293
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 500

Re: Need to determine the value of DIM with attached GTOL

Unread post by josh »

Code: Select all

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
Post Reply