home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
tema
/
ArcData
/
www
/
download
/
LABEL2~1.AVE
< prev
next >
Wrap
Text File
|
1999-12-17
|
2KB
|
66 lines
'-------------------------------------------
'label2shp
'-------------------------------------------
' ┌Φel: p°evßdφ labely ArcView do shp. V atributovΘ tabulce shp jsou ulo₧en text popisu, v²Üku a natoΦenφ.
'
'
' Pou₧itφ: Po kompilaci skriptu vytvo°te novΘ tlaΦφtko v menu tlaΦφtek dokumentu zobrazenφ
' a skript p°i°a∩te jeho vlastnosti Click. TΘma, jeho₧ popisy chcete p°evΘst, musφ b²t aktivnφ.
'-------------------------------------------
aView = av.getActiveDoc
aTheme = aView.getActiveThemes.get(0)
aGraphList = aTheme.getGraphics
aList = {}
aRect = rect.MakeEmpty
av.setStatus (0)
aMax = aGraphList.count
i = 0
aSym = Symbol.Make(#SYMBOL_PEN)
aSymBod = Symbol.Make(#SYMBOL_MARKER)
aDisp = aView.GetDisplay
afilename = fileDialog.Put("c:\temp\label.shp".AsFileName,"*.shp","V²sledn² shapefile")
NewFTab = FTab.MakeNew(aFileName,Point)
FldShp = NewFTab.FindField("Shape")
FldHeight = Field.Make("HEIGHT",#FIELD_FLOAT,6,1)
FldRot = Field.Make("ROTATION",#FIELD_FLOAT,6,1)
FldText = Field.Make("TEXT",#FIELD_CHAR,25,0)
NewFTab.AddFields({FldHeight,FldRot,FldText})
aNewOrig=Point.MakeNull
for each itm in aGraphList
aAngle = itm.getAngle
aOrigin = itm.GetOrigin
aShape = itm.getShape
itm.setAngle(0)
itm.invalidate
aRect = itm.GetBounds
aHeight = aRect.GetHeight
itm.setAngle(aAngle)
itm.invalidate
aText = itm.GetText
rec = NewFTab.AddRecord
NewFTab.SetValue(FldHeight,rec,aHeight)
NewFTab.SetValue(FldText,rec,aText)
NewFTab.SetValue(FldRot,rec,aAngle)
NewFTab.SetValue(FldShp,rec,aorigin)
i = i+1
av.SetStatus((i/aMax)*100)
end
newFTab.SetEditable(FALSE)
av.setStatus (0)