Field-Map Scripting

4.2.1.21 AssignAttribute

ImportShapefile.AssignAttribute procedure


Prototype:

procedure ImportShapefile.AssignAttribute (const From_,To_ :string);

Description:

Specifies the attributes from external shapefile to be assigned to a project layer

Syntax:

Layer.ImportShapefile.AssignAttribute(From, To);


Part

Description


Layer

A reference to the Field-Map layer as defined in Field-Map Project Manager


From

Attributes in the external shapefile


To

Attributes in the destination project layer


Note: This procedure is available since version X7.



Example:


var n:integer;
begin
  RegPoints.ClearTable;
  RegPoints.ImportShapefile.Filename:=ProjectDir+'ToBeImported\Trees_polyg.shp';
  RegPoints.ImportShapefile.AssignAttribute('IDMNGUNITS','IdentificationNumber');
  RegPoints.ImportShapefile.ImportOnlyCentroids:=true;  	
  n:=RegPoints.ImportShapefile.Execute;
  ShowInformation(format('Number of imported entities: %d',[n]));
end.



See also:

Name; Free; ParentName; LayerType; LayerLevel; LayerLabel; AutoTimeStampEnabled; PerformOnChangeScript; PerformOnChangeScriptForAllRecords; PerformLayerScript; OnLineCalliper_AddAttribute; OnLineCalliper_RemoveAttribute; OnLineCalliper_ClearAttributes; OnLineCalliper_GotoAttribute; OnLineCalliper_AddRecordUponReceipt; GetCrownProfileVolumeAndSurface; GetCrownProjectionAsLine; GetCrownProjectionAsPolygon; OpenExternalForm; RelationType; IsValidParentLayer