VCOM:VectorWorks:ISDK::ExportResource: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
 
Line 43: Line 43:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<return>
Returns ...
Returns false when the export failed.
</return>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<remark>
When creating a symbol that should be exported, make sure it is reset and the thumbnail is updated. See sample below.


</remark>
</remark>
Line 53: Line 55:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<sample>
<code lang="cpp">
// Create the File Identifier.
VCOMPtr<IFileIdentifier> file( IID_FileIdentifier );
file->Set( "The path to the folder", "The name of the file.vwx" );
// Create a Symbol Definition with a line in it.
VWSymbolDefObj symExport( "A Symbol Name" );
symExport.AddObject( gSDK->CreateLine( WorldPt( 0, 0 ), WorldPt( 100, 100 ) ) );
// Reset the symbol and update the thumbnail.
symExport.ResetObject();
InternalIndex objectRef = gSDK->GetObjectInternalIndex( symExport.GetThisObject() );
gSDK->UpdateThumbnailPreview( objectRef );


// Export it to an external file.
if ( gSDK->ExportResource( symExport.GetThisObject(), file, true ) == false )
{
// The export failed!
}
</code>
</sample>
</sample>



Latest revision as of 06:46, 22 September 2015

.SDK|SDK ..SDK:Types|SDK Types ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Description

namespace VectorWorks

Member of VCOM:VectorWorks:ISDK

?

virtual bool VCOM_CALLTYPE ExportResource(
MCObjectHandle resource,
IFileIdentifier* pFileID = nil,
bool suppressDialogs = false);

Parameters

resource MCObjectHandle
pFileID IFileIdentifier*
suppressDialogs bool

Return Value

Returns false when the export failed.

Remarks

When creating a symbol that should be exported, make sure it is reset and the thumbnail is updated. See sample below.

Example

	// Create the File Identifier.
	VCOMPtr<IFileIdentifier> file( IID_FileIdentifier );
	file->Set( "The path to the folder", "The name of the file.vwx" );

	// Create a Symbol Definition with a line in it.
	VWSymbolDefObj symExport( "A Symbol Name" );
	symExport.AddObject( gSDK->CreateLine( WorldPt( 0, 0 ), WorldPt( 100, 100 ) ) );

	// Reset the symbol and update the thumbnail.
	symExport.ResetObject();
	InternalIndex objectRef = gSDK->GetObjectInternalIndex( symExport.GetThisObject() );
	gSDK->UpdateThumbnailPreview( objectRef );

	// Export it to an external file.
	if ( gSDK->ExportResource( symExport.GetThisObject(), file, true ) == false )
	{
		// The export failed!
	}

Version

Availability: from Vectorworks 2009