Gets or sets the name of the Sheet.
.NET Syntax
Visual Basic (Declaration) | |
---|
Property Name As System.String |
C# | |
---|
System.string Name {get; set;} |
JavaScript | |
---|
Name : System.String |
)
< A href="GettingStarted-draftsightapi.html">HRESULT set_Name(
BSTR
NewVal
)
C++ | |
---|
property System.String^ Name { dsString* Val
)
DSRESULTput_Name(
const dsString& NewVal
} |
Property Value
Name of the Sheet
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" );
}