Hide Table of Contents
GetBoundingBox Method (ISketchManager)

Gets the bounding box enclosing the sketch entity.

.NET Syntax

Visual Basic (Declaration) 
Sub GetBoundingBox( _
   double* X1 As System.Double, _
   double* Y1 As System.Double, _
   double* Z1 As System.Double, _
   double* X2 As System.Double, _
   double* Y2 As System.Double, _
   double* Z2 As System.Double _
) 
C# 
void GetBoundingBox( 
   out System.double X1,
   out System.double Y1,
   out System.double Z1,
   out System.double X2,
   out System.double Y2,
   out System.double Z2
)
JavaScript 
GetBoundingBox(
) : {
   X1 : Number,
   Y1 : Number,
   Z1 : Number,
   X2 : Number,
   Y2 : Number,
   Z2 : Number
}
COM native C++ 
HRESULT GetBoundingBox( 
   DOUBLE* X1,
   DOUBLE* Y1,
   DOUBLE* Z1,
   DOUBLE* X2,
   DOUBLE* Y2,
   DOUBLE* Z2
) 
C++ 
DSRESULT GetBoundingBox( 
   double* X1,
   double* Y1,
   double* Z1,
   double* X2,
   double* Y2,
   double* Z2
) 

Parameters

X1[out]
x coordinate of a corner of the bounding box
Y1[out]
y coordinate of a corner of the bounding box
Z1[out]
z coordinate of a corner of the bounding box
X2[out]
x coordinate of the opposite diagonal corner of the bounding box
Y2[out]
y coordinate of the opposite diagonal corner of the bounding box
Z2[out] or Return Value
z coordinate of the opposite diagonal corner of the bounding box

Example

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 );
                }
                else
                    fileOutput.WriteString( L"ERROR GetSketchManager\r\n" );
            }
            delete[] sheets;
        }
    }
    else
        fileOutput.WriteString( L"ERROR GetSheets\r\n" );
}

 
 

See Also

Availability

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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   GetBoundingBox Method (ISketchManager)
*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 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.