Hope get distance between plane1 and plane2
record Marco
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
boolstatus = Part.Extension.SelectByID2("Plane2", "PLANE", 0, -0, -0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Plane1", "PLANE", 0, -0, -0, True, 0, Nothing, 0)
End Sub