Hide Table of Contents

Get Multi-jog Leader Data Example (VB.NET)

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.
'-----------------------------------------------------------------------
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System.Runtime.InteropServices
Imports System
Imports System.Diagnostics
 
Partial Class SolidWorksMacro
 
    Public Sub main()
 
        Dim swModel As ModelDoc2
        Dim swDrawingDoc As DrawingDoc
        Dim swSheet As Sheet
        Dim swView As View
        Dim obj As Object
        Dim swAnnotation As Annotation
        Dim swMultiJogLeader As MultiJogLeader
        Dim nbrLines As Integer
        Dim lineData As Object
        Dim lineType As Integer
        Dim startPointX As Double
        Dim startPointY As Double
        Dim startPointZ As Double
        Dim endPointX As Double
        Dim endPointY As Double
        Dim endPointZ As Double
        Dim i As Integer
 
        'Get multi-jog leader
        swModel = swApp.ActiveDoc
        swDrawingDoc = swModel
        swSheet = swDrawingDoc.GetCurrentSheet
        Debug.Print("Sheet name: " & swSheet.GetName)
        'First view is Sheet, so get next view
        swView = swDrawingDoc.GetFirstView
        swView = swView.GetNextView
        Debug.Print("View name: " & swView.GetName2)
        obj = swView.GetFirstMultiJogLeader
        swMultiJogLeader = obj

        'Get multi-jog leader data
        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 lineData Is Nothing Then
                Debug.Print(" Line " & i + 1 & ":")
                lineType = lineData(0)
                startPointX = lineData(1)
                startPointY = lineData(2)
                startPointZ = lineData(3)
                endPointX = lineData(4)
                endPointY = lineData(5)
                endPointZ = lineData(6)
                Debug.Print("  Line type as defined by swLineTypes_e: " & lineType)
                Debug.Print("  Line x, y, and z start points: " & startPointX & ", " & startPointY & ", and " & startPointZ)
                Debug.Print("  Line x, y, and z end points: " & endPointX & ", " & endPointY & ", and " & endPointZ)
            End If
        Next i
        Debug.Print("Number of arrow heads in multi-jog leader: " & swMultiJogLeader.GetArrowHeadCount)
 
 
    End Sub
 
    ''' <summary>
    ''' The SldWorks swApp variable is pre-assigned for you.
    ''' </summary>
    Public swApp As SldWorks
 
 
End Class


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 (VB.NET)
*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) 2018 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.