Hide Table of Contents
SetLeaderAttachmentPointAtIndex Method (IAnnotation)

Sets the specified attachment point of a leader for an annotation with the specified index.

.NET Syntax

Visual Basic (Declaration) 
Function SetLeaderAttachmentPointAtIndex( _
   ByVal Index As System.Integer, _
   ByVal X As System.Double, _
   ByVal Y As System.Double, _
   ByVal Z As System.Double _
) As System.Boolean
Visual Basic (Usage) 
Dim instance As IAnnotation
Dim Index As System.Integer
Dim X As System.Double
Dim Y As System.Double
Dim Z As System.Double
Dim value As System.Boolean
 
value = instance.SetLeaderAttachmentPointAtIndex(Index, X, Y, Z)
C# 
System.bool SetLeaderAttachmentPointAtIndex( 
   System.int Index,
   System.double X,
   System.double Y,
   System.double Z
)
C++/CLI 
System.bool SetLeaderAttachmentPointAtIndex( 
&   System.int Index,
&   System.double X,
&   System.double Y,
&   System.double Z
) 

Parameters

Index
Index of annotation (see Remarks)
X
x-coordinate of attachment point
Y
y-coordinate of attachment point
Z
z-coordinate of attachment point

Return Value

True if leader attached successfully, false if not

Example

'VBA example
'Open a drawing.
'Select a view with one note annotation.
'No other annotations are present.
'If there are other annotations, modify Index in the
'method call below to point to the note annotation.
================================
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDrawing As SldWorks.DrawingDoc
Dim swAnnot As SldWorks.Annotation
Dim vAnnotations As Variant
Dim swView As SldWorks.View
Dim i As Integer
Dim bRet As Boolean
Dim cnt As Long
Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
   
    Set swDrawing = swModel
    Set swView = swDrawing.ActiveDrawingView
   
    Debug.Assert Not swView Is Nothing
    Debug.Print "Name of drawing view: " & swView.GetName2
   
    vAnnotations = swView.GetAnnotations
   
    For i = 0 To UBound(vAnnotations)
        Set swAnnot = vAnnotations(i)
        swAnnot.Select3 True, Nothing
   
        cnt = swAnnot.GetLeaderCount
        If cnt = 1 Then
            bRet = swAnnot.SetLeaderAttachmentPointAtIndex(0, 0.687021207260901, 0.599975917260352, 250.03275)
            If (bRet) Then
                Debug.Print "Leader attached successfully"
            End If
        End If
    Next i
End Sub

Remarks

The annotation must be of a type that supports leaders. Only notes, GTols, surface finish symbols, weld symbols, datum target symbols, and block instances support leaders of any kind.
 

See Also

Availability

SOLIDWORKS 2018 SP02, Revision Number 26.2


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   SetLeaderAttachmentPointAtIndex Method (IAnnotation)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2022 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.