AutoCAD Map 3D 2009 Geospatial Platform Reference

AutoCAD Map 3D Geospatial Platform API

virtual MgByteReader* MgResourceService::GetResourceData ( MgResourceIdentifier resource,
CREFSTRING  dataName 
) [virtual]

Returns the resource data for the specified resource.

.NET Syntax
MgByteReader GetResourceData(MgResourceIdentifier resource, string dataName);
Java Syntax
MgByteReader GetResourceData(MgResourceIdentifier resource, String dataName);
PHP Syntax
MgByteReader GetResourceData(MgResourceIdentifier resource, string dataName);

Parameters:
resource (MgResourceIdentifier) The resource for which the resource data will be obtained.
dataName (String/string) Name for data (as specified when the data was set via SetResourceData ).
Returns:
Returns an MgByteReader object containing the resource data.
Example (PHP)
 // Assuming that $resourceService has already been initialized
 $resourceID = new MgResourceIdentifier("Library://Geography/Calgary points of interest.FeatureSource");
 $byteReader = $resourceService->GetResourceData($resourceID, "locations of points of interest");
 $byteSink = new MgByteSink($byteReader);
 $byteSink->ToFile('C:\temp\points.sdf');

Exceptions:
MgResourceDataNotFoundException 
MgInvalidResourceTypeException 
See also:
SetResourceData

EnumerateResourceData

RenameResourceData

DeleteResourceData