NaWin55
Mechanical
- Mar 21, 2020
- 98
Hi everyone
I have this issue getting the values of co-Ordinates to text boxes
i need to get the horizontal(X) and Vertical(Y) values to the textboxes
here is the userform
Here is the image with points
When i click on any point(those points 2d Sketch points Not wireframe points)
i need to get the hpizontal and vertical values of the picked point
here is the code i have done but dont know how to proceed further
Private Sub SelectPnt_Click()
Set oSelPoint = CATIA.ActiveDocument.Selection
oSelPoint.Clear
Dim vertexFilter(0) As Variant
vertexFilter(0) = "Vertex"
Dim vertexStatus As String
vertexStatus = oSelPoint.SelectElement2(vertexFilter, "Select Anyobject", False)
If (vertexStatus = "Cancel") Then
MsgBox "User Cancelled"
Else
opart.InWorkObject = oSelPoint.Item(1).Value
Dim osketch As Sketch
Set osketch = opart.InWorkObject
MsgBox opart.InWorkObject.Name
Dim ofact2d As Factory2D
Set ofact2d = osketch.OpenEdition
Dim oPoint As point2D
oPoint.GetCoordinates
End If
End Sub
what's the solution for this
Thanks
I have this issue getting the values of co-Ordinates to text boxes
i need to get the horizontal(X) and Vertical(Y) values to the textboxes
here is the userform

Here is the image with points

When i click on any point(those points 2d Sketch points Not wireframe points)
i need to get the hpizontal and vertical values of the picked point
here is the code i have done but dont know how to proceed further
Private Sub SelectPnt_Click()
Set oSelPoint = CATIA.ActiveDocument.Selection
oSelPoint.Clear
Dim vertexFilter(0) As Variant
vertexFilter(0) = "Vertex"
Dim vertexStatus As String
vertexStatus = oSelPoint.SelectElement2(vertexFilter, "Select Anyobject", False)
If (vertexStatus = "Cancel") Then
MsgBox "User Cancelled"
Else
opart.InWorkObject = oSelPoint.Item(1).Value
Dim osketch As Sketch
Set osketch = opart.InWorkObject
MsgBox opart.InWorkObject.Name
Dim ofact2d As Factory2D
Set ofact2d = osketch.OpenEdition
Dim oPoint As point2D
oPoint.GetCoordinates
End If
End Sub
what's the solution for this
Thanks