Hi Everyone,
I have a number of point in a view for which in need get (x,y,z) coordinates and the add a text with leader need to add the coordinates and some text.
I'm trying automate it. I could able to select the required points but not able to get the coordinates.
Help is much appreciated.
Sub CATMain()
Dim i As Integer
Dim coord(2)
Dim dwgDoc As DrawingDocument
Set dwgDoc = CATIA.ActiveDocument
Dim dwgViews As DrawingViews
Set dwgViews = CATIA.ActiveDocument.Sheets.ActiveSheet.Views
Dim dwgView As DrawingView
Set dwgView = dwgViews.ActiveView
Dim Point1 As Point2D
Dim pointSel As Selection
Set pointSel = dwgDoc.Selection
pointSel.Search "Name='GeneratedPoint Point',sel"
MsgBox pointSel.Count
For i = 1 To pointSel.Count
Set Point1 = pointSel.Item(i)
Point1.GetCoordinates (coord)
MsgBox "(" & coord(0) & ", " & coord(1) & " ," & coord(2) & ")"
Next
pointSel.Clear
End Sub
Thnaks,
Sriram
I have a number of point in a view for which in need get (x,y,z) coordinates and the add a text with leader need to add the coordinates and some text.
I'm trying automate it. I could able to select the required points but not able to get the coordinates.
Help is much appreciated.
Sub CATMain()
Dim i As Integer
Dim coord(2)
Dim dwgDoc As DrawingDocument
Set dwgDoc = CATIA.ActiveDocument
Dim dwgViews As DrawingViews
Set dwgViews = CATIA.ActiveDocument.Sheets.ActiveSheet.Views
Dim dwgView As DrawingView
Set dwgView = dwgViews.ActiveView
Dim Point1 As Point2D
Dim pointSel As Selection
Set pointSel = dwgDoc.Selection
pointSel.Search "Name='GeneratedPoint Point',sel"
MsgBox pointSel.Count
For i = 1 To pointSel.Count
Set Point1 = pointSel.Item(i)
Point1.GetCoordinates (coord)
MsgBox "(" & coord(0) & ", " & coord(1) & " ," & coord(2) & ")"
Next
pointSel.Clear
End Sub
Thnaks,
Sriram