home *** CD-ROM | disk | FTP | other *** search
Wrap
'------------multipoint2point------------------------- '┌Φel: p°evßdφ aktivnφ tΘma typu multipoint na tΘma typu point. 'Pou₧itφ: po kompilaci skriptu p°idejte do menu tlaΦφtek v rozhranφ pro dokument Zobrazenφ novΘ tlaΦφtko a jeho vlastenosti Click tento skript p°i°a∩te. P°ed spuÜt∞nφm ud∞lejte tΘma typu multipoint aktivnφ. Atributy ka₧dΘho p°evßd∞nΘho prvku jsou p°i°azeny vÜem nov∞ vznikl²m bod∙m. mpthm = MsgBox.Choice (av.getactivedoc.getthemes, "Vyberte tΘma typu MULTIPOINT:", "") if(mpthm=nil) then return nil end aftab = mpthm.getftab ashape = aftab.findfield("shape") if(ashape.gettype <> #FIELD_SHAPEMULTIPOINT) then msgbox.warning("TΘma nenφ typu MULTIPOINT!","") return nil end if(aftab.getfields.count < 2) then msgbox.warning("TΘma musφ mφt alespo≥ 2 pole!","") return nil end pfn = FileDialog.Put ("point.shp".AsFilename, "*.shp", "") nftab = FTab.MakeNew (pfn, Point) newshape = nftab.findfield("shape") nlist={} for each f in aftab.getfields if (f.GetName = "Shape") then continue else fCopy = f.Clone nlist.Add(fCopy) end end nftab.SetEditable(true) nftab.addfields(nlist) if (nftab.CanAddRecord) then for each reca in aftab mp = aftab.returnvalue(ashape,reca) plist = mp.aslist for each p in plist i = nftab.AddRecord nftab.SetValue(newshape,i,p) for each f in nlist nftab.SetValue(f,i,aftab.returnvalue(aftab.findfield(f.getname),reca)) end end end else msgbox.warning("Nelye p°idat zßznam!","") return nil end nftab.SetEditable(false) viewList = {} for each d in av.GetProject.GetDocs if (d.Is(View)) then viewList.Add( d ) end end if (MsgBox.YesNo("P°idat tΘma do zobrazenφ?","", true).Not) then exit end viewList.Add("<New View>") addToView = MsgBox.ListAsString( viewList,"Vyberte zobrazenφ", "" ) if (addToView <> nil) then if (addToView = "<New View>") then addToView = View.Make addToView.GetWin.Open end ptheme = FTheme.Make(nfTab ) addToView.AddTheme(ptheme) addToView.GetWin.Activate end