'***********************************************************
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.modelDoc
Dim swSelMgr As SldWorks.SelectionMgr
Dim swFeat As SldWorks.Feature
Dim swTableFeatData As SldWorks.TablePatternFeatureData
Dim swRefPt As SldWorks.Vertex
Dim swCoordSys As SldWorks.Feature 'Object
Dim vBasePt As Variant
Dim vFace As Variant
Dim vFeat As Variant
Dim vPt As Variant
Dim nPtType As Long
Dim vRefPtParam As Variant
Dim bRet As Boolean
Dim i As Long
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager
Set swFeat = swSelMgr.GetSelectedObject5(1)
Set swTableFeatData = swFeat.GetDefinition
' Roll back to get the reference point
bRet = swTableFeatData.AccessSelections(swModel, Nothing): Debug.Assert bRet
' Set swRefPt = swTableFeatData.ReferencePoint
Set swCoordSys = swTableFeatData.CoordinateSystem
vBasePt = swTableFeatData.GetBasePoint
vFace = swTableFeatData.PatternFaceArray
vFeat = swTableFeatData.PatternFeatureArray
vPt = swTableFeatData.PointArray
Debug.Print swFeat.Name
Debug.Print " Coord sys = " & swCoordSys.Name
Debug.Print " FaceCount = " & swTableFeatData.GetPatternFaceCount
Debug.Print " FeatureCount = " & swTableFeatData.GetPatternFeatureCount
Debug.Print " PointCount = " & swTableFeatData.GetPointCount
Debug.Print " ReferencePointType = " & swTableFeatData.GetReferencePointType
Debug.Print " BasePt = (" & vBasePt(0) * 1000# & ", " & vBasePt(1) * 1000# & ", " & vBasePt(2) * 1000# & ") mm"
Debug.Print " GeometryPattern = " & swTableFeatData.GeometryPattern
Debug.Print " UseCentroid = " & swTableFeatData.UseCentroid
retval = swTableFeatData.SavePointsToFile("C:\Stuff.SLDTAB")
Debug.Print "retval = " & retval
swTableFeatData.PointArray = Array(0.37445, 0.0254, 0.37445, 0.15006, 0.37445, 0.27472, 0.37445, 0.39998, 0.22, 0.0254, 0.22, 0.15006, 0.22, 0.27472)
If Not swRefPt Is Nothing Then
' Is NULL if centroid used
vRefPtParam = swRefPt.GetPoint
Debug.Print " RefPt = (" & vRefPtParam(0) * 1000# & ", " & vRefPtParam(1) * 1000# & ", " & vRefPtParam(2) * 1000# & ") mm"
End If
' Roll forward
swTableFeatData.ReleaseSelectionAccess
End Sub
'***********************************************************