MGDwgDataSources.setKeyColumnType   Go to object model Go to parent topic Go to previous topic Go to next topic

Syntax

boolean setKeyColumnType(string keyColumnType) 

Description

Sets the DWG key column data type.

This method is not case-sensitive.

If this method is successful, it automatically sets the layer's rebuild flag to True. See setRebuild for more information.

Note that this method does not work during a busy state. For additional information about the busy state, refer to "Handling Busy State and Map Refresh" in the Autodesk MapGuide Developer's Guide.

Parameters

keyColumnType - The data type that you want the key column to be set to. Values can be: Boolean, Byte, Date, Decimal, Double, Float, Integer, Numeric, SmallInt, String, Time, TimeStamp, Unsigned Byte, UnsignedInteger, or UnsignedSmallInt.

Returns

boolean - Returns True if successful; otherwise returns False.

Error Codes

-1 (busy)

-3 (illegal argument)

Example

This code is designed to work with the 1stfloorplanEx6.mwf file used by the Filter DWG Layers example:

function setProperties()
{
   // Get the map and selected features
   var map = getMap();
   var mapSel = map.getSelection();
   // Use the single map layer Floor Plan
   var mapLayer = map.getMapLayer("Floor Plan");
   // Get DWG data source object for the layer
   var mapLayerSetup = mapLayer.getLayerSetup();
   var dwgMapLayerDataSource = mapLayerSetup.getDwgDataSources();
   dwgMapLayerDataSource.setKeyColumnType("Integer");
}

See Also

getKeyColumnType, KeyColumnType