Hello
I have a personal coordinate system
I have stitches in the assembly
I can measure these points manually to get the X/Y/Z coordinates
I develop a macro to automate this task and send me the list of points and their coordinates.
I can measure the points but it does it according to the default coordinate system, and not with the one I want
Here is the snippet of my code that reads the coordinates in a folder called "connections":
If (typeName = "FtrFolder" And swFeature.Name = "Connexions") Then
Debug.Print swFeature.Name
Debug.Print " Current coordinate system = " & swModel.GetUserPreferenceStringValue(swFileSaveAsCoordinateSystem)
Set swFeatFolder = swFeature.GetSpecificFeature2
Features = swFeatFolder.GetFeatures
Debug.Print " Number of Features: " & swFeatFolder.GetFeatureCount
For i = 0 To (swFeatFolder.GetFeatureCount - 1)
Set swFtrFolder = Features(i)
Debug.Print " Name of feature: " & swFtrFolder.Name
Debug.Print " Type of feature: " & swFtrFolder.GetTypeName2
Set swRefPt = swFtrFolder.GetSpecificFeature2
Set swRefPtData = swFtrFolder.GetDefinition
Set swMathPt = swRefPt.GetRefPoint
'Debug.Print "File = " & swModel.GetPathName
'Debug.Print " " & swFeat.Name
Debug.Print " Pt = (" & swMathPt.ArrayData(0) * 1000# & ", " & swMathPt.ArrayData(1) * 1000# & ", " & swMathPt.ArrayData(2) * 1000# & ") mm"
Debug.Print " AlongCurveOption = " & swRefPtData.AlongCurveOption
Debug.Print " Distance = " & swRefPtData.Distance * 1000# & " mm"
Debug.Print " Type = " & swRefPtData.Type
Next i
End If
Thank you in advance for your help
Cédric