Hide Table of Contents
GetSketchManager Method (ISheet)

Gets the sketch interface.

.NET Syntax

Visual Basic (Declaration) 
Function GetSketchManager() As SketchManager
SketchManager GetSketchManager()
GetSketchManager() : dsSketchManager
COM native C++ 
HRESULT GetSketchManager(
   ISketchManager** SkMngr
DSRESULT GetSketchManager(
   dsSketchManager** SkMngr


SkMngr[out] or Return Value


This code snippet shows how to get the Sheets, their names, and the bounding box coordinates.

COM native C++

void CAddinDumpManager::DumpSheets( CStdioFile& fileOutput, LPCWSTR tabStr, IDocumentPtr dsDoc )
    CString strPrint;
    _variant_t pVariantArray = dsDoc->GetSheets();
    if( V_VT( &pVariantArray ) != VT_EMPTY )
        ISheetPtr *sheets = NULL;
        int count = 0;
        TypeConverter::convertVariantArrayToPtrArray<ISheetPtr, ISheet>( pVariantArray, sheets, count );

        strPrint.Format( L"Sheets: (%d):\r\n", count );
        fileOutput.WriteString( strPrint );

        if( sheets && count > 0 )
            //Iterate through Block instances
            for( int i = 0; i < count; ++i )
                //Get Sheet name
                bstr_t SheetName= sheets[i]->GetName();

                strPrint.Format( L"Name: %s\r\n", SheetName.operator const wchar_t*() );
                fileOutput.WriteString( strPrint );
                //Get ISketchManager object
                ISketchManagerPtr dsSketchManagerSheet( sheets[i]->GetSketchManager() );
                if( dsSketchManagerSheet != NULL )
                    //Get Sheet bounding box
                    double x1, y1, z1, x2, y2, z2;
                    dsSketchManagerSheet->GetBoundingBox( &x1, &y1, &z1, &x2, &y2, &z2 );

                    strPrint.Format( L"Bounding box: %.4f %.4f %.4f %.4f\r\n", x1, y1, x2, y2 );
                    fileOutput.WriteString( strPrint );
                    fileOutput.WriteString( L"ERROR GetSketchManager\r\n" );
            delete[] sheets;
        fileOutput.WriteString( L"ERROR GetSheets\r\n" );


See Also


DraftSight V1R1

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:   GetSketchManager Method (ISheet)
*   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) 2019 SP04

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.