Pesan Website

SAMPEL SCRIPT AVENUE : MEMBUAT INSET VIEW DENGAN AUTO UPDATE

Sampel Script avenue berikut ini berfungsi untuk membuat view inset yang terupdate secara otomatis sesuai zooming yang digunakan oleh user. Cara menggunakannya, kompilasikan script berikut, lalu kaitkan dengan fungsi “update” pada tool ZoomIn dan ZoomOut bisa juga pada button ZoomIn dan ZoomOut. Pemahaman dasar tentang script Avenue bisa diperoleh pada Tutorial ArcView 3.x, dan posting yang lain tentang Avenue Pendahuluan, Avenue Dialog Designer 1 dan Avenue Dialog Designer 2.
vie = av.getactivedoc
skala = vie.returnscale
nam = vie.getname
d = vie.GetDisplay
r = d.ReturnVisExtent
r2 = vie.returnextent
theView = av.finddoc(“Inset”)
if (theView = nil) then
newView = View.MakeWithGUI(“View”)
newView.GetWin.Open
newview.setname(“Inset”)
theView = newView
end
theView.GetDisplay.SetExtent(r2.Scale(1.1))
lis = theview.GetGraphics.findallbyclass(graphicshape)
if ((lis = nil) or (lis.count = 0)) then
kotak = GraphicShape.Make (r)
asimb = Symbol.Make (#SYMBOL_FILL)
asimb.setolcolor(color.getred)
afil = rasterfill.make
afil.setstyle(#RASTERFILL_STYLE_EMPTY)
afil.setolcolor(color.getred)
kotak.setsymbol(asimb)
kotak.setsymbol(afil)
theView.getgraphics.add(kotak)
else
kotak = lis.get(0)
kotak.setbounds(r)
asimb = Symbol.Make (#SYMBOL_FILL)
asimb.setolcolor(color.getred)
afil = rasterfill.make
afil.setstyle(#RASTERFILL_STYLE_EMPTY)
afil.setolcolor(color.getred)
kotak.setsymbol(asimb)
kotak.setsymbol(afil)
end
theview.invalidate
av.finddoc(nam).getwin.activate
theView = av.GetActiveDoc
SELF.SetEnabled((theView.GetGraphics.Count > 0) or (theView.GetThemes.Count > 0))
av.TileWindows
Posting sampel script avenue ini ditulis oleh Satrio Arditama, alumni Geografi UI angkatan 1999, saat ini bekerja di Departemen Pekerjaan Umum. Secara berkala Satrio akan memberikan sampel script avenue dan contoh aplikasi WebGIS. Untuk menghubungi penulis silahkan kirim email ke iarditama@gmail.com

sumber : Pesanovi
Powered by Blogger.