Написал скрипт, он выполняется, однако сетку и подписи не видно. Ниже привожу текст скрипта.
Буду признателен за помощь. Сергей.
theView=av.GetActiveDoc
viewUnits=theView.GetDisplay.GetUnits
viewProj=theView.GetProjection
theRect=theView.ReturnUserRect
if (theRect=nil) then
exit
end
llx=therect.getleft
lly=therect.getBottom
theWidth=therect.getwidth
theHeight=therect.getheight
rows=Msgbox.Input("Сколько рядов (вверх/вниз):","привет","10")
if ((rows = nil) or (rows.asNumber 1) then
col_prefix=letters.middle((c/26).floor-1,1)
else
col_prefix=""
end
if (c.Mod(26) = 0) then
col_name=letters.Middle(25,1)
else
col_name=letters.Middle(c.Mod(26)-1,1)
end
col_id=col_prefix+col_name
originx=llx+((c-1)*csize)
originy=lly+((r-1)*rsize)
size=csize@rsize
origin=originx@originy
rct=rect.make(origin,size)
if (viewunits=#UNITS_LINEAR_METERS) then
rct=rct.ReturnUnprojected(viewproj)
end
newrec=gridftab.AddRecord
gridftab.SetValue(shpfield,newrec,rct.aspolygon)
gridftab.SetValue(labfield,newrec,col_id+row_id)
end
end
gridftab.SetEditable(false)
av.clearMsg
mytheme=ftheme.Make(gridftab)
mysym=av.GetSymbolWin.GetPalette.GetList(#PALETTE_LIST_FILL).Get(0)
mysym.setolwidth(2)
mytheme.GetLegend.GetSymbols.Set(0,mysym)
mytheme.SetName("Grid")
mytheme.SetActive(true)
myTheme.SetVisible(true)
theview.AddTheme(mytheme)
mytheme.Invalidate(true)
theview.GetDisplay.Flush
yn=MsgBox.YesNo("Надписать сетку?","Gridmaker",true)
if (yn) then
for each thm in theView.GetThemes
if (thm mytheme) then
thm.SetActive(False)
end
end
theView.LabelThemes(false)
end
|