VCOM:VectorWorks:ISDK::ExportResource

From Vectorworks Developer
Revision as of 06:46, 22 September 2015 by Maarten (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.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