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