GopinadhGvs
Mechanical
- Mar 30, 2015
- 4
macro to change all the Leader Symbol shapes to Filled Circle
Here is the macro i am trying, to change the leader symbol shape for all texts having leaders.
'Option Explicit
Sub CATMain()
Dim drawingDocument1 As DrawingDocument
Set drawingDocument1 = CATIA.ActiveDocument
Dim selection1 As Object
Set selection1 = drawingDocument1.Selection
selection1.Search "(CATTPSSearch.CATTPSText + CATDrwSearch.DrwText), all"
Dim oText As DrawingText
Dim oLeader As DrawingLeader
For i = 1 To selection1.Count2
Set oText = selection1.Item2(i).Value
If oText.Leaders.Count > 0 Then -> Error is here
For Each oLeader In oText.Leaders
oLeader.HeadSymbol = catFilledCircle
Next
End If
Next
End Sub
Please help me to solve this issue..
Here is the macro i am trying, to change the leader symbol shape for all texts having leaders.
'Option Explicit
Sub CATMain()
Dim drawingDocument1 As DrawingDocument
Set drawingDocument1 = CATIA.ActiveDocument
Dim selection1 As Object
Set selection1 = drawingDocument1.Selection
selection1.Search "(CATTPSSearch.CATTPSText + CATDrwSearch.DrwText), all"
Dim oText As DrawingText
Dim oLeader As DrawingLeader
For i = 1 To selection1.Count2
Set oText = selection1.Item2(i).Value
If oText.Leaders.Count > 0 Then -> Error is here
For Each oLeader In oText.Leaders
oLeader.HeadSymbol = catFilledCircle
Next
End If
Next
End Sub
Please help me to solve this issue..