Wanneer je in deze database bij iedere stip de
Amersfoortcoördinaten wilt toevoegen moet dat met een script.; script
maken, compilen en runnen:
Klik in het project (*.apr) op Scripts | New.Geef meteen het Script een naam zodat je weet waar het over gaat b.v. Als je onderstaand scherm ziet; selecteer Script1 Terug in de view selecteer je de shapefile waarbij je de Amersfoortcoördinaten
wilt toevoegen.
X-coord en Y-coord
Wanneer je nieuwe stippen aan de shapefile toevoegd word niet de coördinaten
toegevoegd. Hiervoor moet je steeds opnieuw het script laten runnen.
|
theView = av.GetActiveDoc
'must be global to work in Calc exp below _theProjection = theView.GetProjection project_flag = _theProjection.IsNull.Not 'true if projected theTheme = theView.GetActiveThemes.Get(0) 'Check if point or polygon theme
'get the theme table and current edit state theFTab = theTheme.GetFTab
'make sure table is editable and that fields can be added
return nil
'Check if fields named "X-coord" and Y-coord" exist
if (x_exists or y_exists) then
theFTab.RemoveFields({theFTab.FindField("X-coord")})
x = Field.Make ("X-coord",#FIELD_DECIMAL,18,5)
'Get point coordinates or polygon centroid coordinates
'Projection defined
else
'Return editing state to pre-script running state
|