Hide Table of Contents

Get Break Line Data Example (VB.NET)

This example shows how to get information on all break lines in a view.

' Preconditions:
' 1. Create or open a drawing with one or more views that contain
'    one or more break lines.
' 2. Open an Immediate Window.
' Postconditions: Inspect the Immediate Window.
' ---------------------------------------------------------------------------
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System
Imports System.Diagnostics

Partial Class SolidWorksMacro

Dim Draw As DrawingDoc
Dim swActiveView As View
Dim Size As Long
    Dim Breaks As Long
    Dim info As Object
    Dim boolstatus As Boolean

    Sub main()

        Draw = swApp.ActiveDoc
Dim count As Long
        count = Draw.GetViewCount
"There are " & count & " views in this drawing including the sheet view.")
Dim i As Long
        Dim j As Long
        swActiveView = Draw.GetFirstView ' get the sheet
        swActiveView = swActiveView.GetNextView ' get the first view
        For i = 0 To count - 2
"View " & i + 1)
            Breaks = swActiveView.GetBreakLineCount2(Size)
"   Number of breaks is " & Breaks)
"   Size of break line data array is " & Size)

If Not Breaks = 0 Then
                info = swActiveView.GetBreakLineInfo2

' Break line information
                Debug.Print("   First break line:")
"     Break line style: " & info(0))
"     Break line color: " & info(1))
"     Break line linetype: " & info(2))
"     Break line linestyleindex: " & info(3))
"     Break line lineweight: " & info(4))
"     Break line layerid: " & info(5))
"     Break line layerOverride: " & info(6))
"     Number of line segments in this break line: " & info(7))
"     Number of arcs in this break line: " & info(8))

' Start and end point data for all segments in this break line
                ' and data for other break lines in this view
"     Start and end point data for the break line above")
"     and data for other break lines in this view:")

For j = 9 To Size - 1
"      " & info(j))
Next j

End If
            swActiveView = swActiveView.GetNextView
Next i

End Sub

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

Subject:   Feedback on Help Topics
Page:   Get Break Line Data Example (VB.NET)
*   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:


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

Web Help Content Version: API Help (English only) 2016 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.