Hide Table of Contents

Get Multi-jog Leader Data Example (VBA)

This example shows how to get data for a multi-jog leader.

'-----------------------------------------------------------------------
' Preconditions:
' 1. Open a drawing document with at least one multi-jog leader.
' 2. Open the Immediate window.
'
' Postconditions:
' 1. Selects a multi-jog leader.
' 2. Gets data for the multi-jog leader.
' 3. Examine the Immediate window.
'-----------------------------------------------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDrawingDoc As SldWorks.DrawingDoc
Dim swSheet As SldWorks.Sheet
Dim swView As SldWorks.View
Dim obj As Object
Dim swAnnotation As SldWorks.Annotation
Dim swMultiJogLeader As SldWorks.MultiJogLeader
Dim nbrLines As Long
Dim lineData As Variant
Dim i As Long
Sub main()
    Set swApp = Application.SldWorks    
    'Get multi-jog leader
    Set swModel = swApp.ActiveDoc
    Set swDrawingDoc = swModel
    Set swSheet = swDrawingDoc.GetCurrentSheet
    Debug.Print "Sheet name: " & swSheet.GetName
    'First view is Sheet, so get next view
    Set swView = swDrawingDoc.GetFirstView
    Set swView = swView.GetNextView    
    Debug.Print "View name: " & swView.GetName2
    Set obj = swView.GetFirstMultiJogLeader
    Set swMultiJogLeader = obj        
    'Get multi-jog leader data
    Set swAnnotation = swMultiJogLeader.GetAnnotation
    Debug.Print "Annotation name: " & swAnnotation.GetName
    Debug.Print "Type of annotation (11 = multi-jog leader): " & swAnnotation.GetType
    nbrLines = swMultiJogLeader.GetLineCount
    Debug.Print "Number of lines in multi-jog leader: " & nbrLines
    lineData = swMultiJogLeader.GetLineAtIndex(1)
    For i = 0 To nbrLines - 1
        If Not IsEmpty(lineData) Then
            Debug.Print " Line " & i + 1 & ":"
            Debug.Print "  Line type as defined by swLineTypes_e: " & lineData(0)
            Debug.Print "  Line x, y, and z start points: " & lineData(1) & ", " & lineData(2) & ", and " & lineData(3)
            Debug.Print "  Line x, y, and z end points: " & lineData(4) & ", " & lineData(5) & ", and " & lineData(6)
        End If
    Next i        
    Debug.Print "Number of arrow heads in multi-jog leader: " & swMultiJogLeader.GetArrowHeadCount    
End Sub


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:   Get Multi-jog Leader Data Example (VBA)
*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) 2021 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.