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

From Vectorworks Developer
Jump to: navigation, search
m (1 revision)
 
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 02: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
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox