Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically Leader the Point Labels When Placing a Coordinate Dimension Table

Status
Not open for further replies.

TWCURRY

Automotive
Oct 9, 2009
6
US
Can this be done? When we create the Coordinate Dimension Table, each point gets a text label next to it, but no leader. We always have to go back through all of the points and use the Add Leader command on each text label and click the respective point.

Is there a style setting in the Standards or an Option that I'm missing to turn on automatic leaders to these texts?
 
Replies continue below

Recommended for you

This should fix it. Just select all your texts before running it.

Code:
Sub CATMain()
    Dim oDrw As DrawingDocument
    Set oDrw = CATIA.ActiveDocument
    For i = 1 To oDrw.Selection.Count
        On Error Resume Next
        Dim oText As DrawingText
        Set oText = oDrw.Selection.Item(i).Value
        If oText.Leaders.Count = 0 Then
            Set oPoint = oText.AssociativeElement
            Dim arra(1)
            oPoint.GetCoordinates arra
            oText.Leaders.Add arra(0), arra(1)
        End If
    Next
    On Error GoTo 0
End Sub

Hope it helps,
Calin
 
Thank you very much, but what would one do with that?
 
As there is no style setting, standard setting or application setting that will create your leaders for you, the above code will create all those Leaders for you.

1. Select your texts
2. Run the script.
3. That's it: leaders are going to be created automatically so you won't lose time doing them.

Hope that's clearer,
Calin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top