Hide Table of Contents

Get Text Items in GTol Frame Example (VB.NET)

This example shows how to get text items, values, and symbols in a GTol frame.

'------------------------------------------------------------- 
' Preconditions: 
' 1. Open a document with a GTol frame and select that GTol 
'    frame.
' 2. Open an Immediate window.

' Postconditions: 
' 1. Gets the text items, values, and symbols in the
'    selected GTol frame. 
' 2. Examine the Immediate window.
'------------------------------------------------------------- 
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System.Diagnostics
Imports System
 
Partial Public Class SolidWorksMacro
 
    Public Sub Main()
 
        Dim swModel As ModelDoc2
        Dim swModelDocExt As ModelDocExtension
        Dim swSelMgr As SelectionMgr
        Dim swGtol As Gtol
 
        swModel = swApp.ActiveDoc
        swModelDocExt = swModel.Extension
        swSelMgr = swModel.SelectionManager
        swGtol = swSelMgr.GetSelectedObject6(1, -1)
 
        Debug.Print("GetTextCount = " & swGtol.GetTextCount().ToString())
 
        For idx As Integer = 0 To swGtol.GetTextCount() - 1
            Debug.Print(("GetTextAtIndex(" & idx.ToString() & ") = ") + swGtol.GetTextAtIndex(idx))
        Next
 
        Debug.Print("GetFrameCount = " & (swGtol.GetFrameCount().ToString()) - 1)
 
        For idx As Integer = 1 To swGtol.GetFrameCount() - 1
            Dim myParams As Object
            Dim arrSymbols As Object
            myParams = swGtol.GetFrameValues(idx)
            If myParams IsNot Nothing Then
                Debug.Print(((((("GetFrameValues(" & idx.ToString() & ") = ") & myParams.GetValue(0) & ",") & myParams.GetValue(1) & ",") & myParams.GetValue(2) & ",") & myParams.GetValue(3) & ",") & myParams.GetValue(4))
                arrSymbols = swGtol.GetFrameSymbols3(idx)
                Debug.Print(((((((("  GetFrameSymbols3(" & idx.ToString() & ") = ") & arrSymbols(0) & ", " & arrSymbols(1) & ", " & arrSymbols(2) & ", " & arrSymbols(3) & ", " & arrSymbols(4) & ", " & arrSymbols(5) & ")")))))))
            End If
        Next
 
    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 Text Items in GTol Frame 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) 2019 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.