HOW TO
This article shows how to create a button on the Layout GUI that will place a shadow box around a selected layout frame.
Code:
thelay = av.getactivedoc
theglist = thelay.getgraphics
thesel = theglist.getselected
theshapefirst = thesel.get(0)
theshapesecond = theshapefirst.getshape
theshape = theshapesecond.scale(1.1)
shapea = graphicshape.make(theshape)
theglist.add(shapea)
shapeb = graphicshape.make(theshape)
theglist.add(shapeb)
thesymbol = rasterfill.make
thesymbol.setstyle(#rasterfill_style_solid)
thesymbol.setcolor(color.getblack)
shapea.setsymbol(thesymbol)
shapea.invalidate
thesymbolb = rasterfill.make
thesymbolb.setstyle(#rasterfill_style_solid)
thesymbolb.setcolor(color.getwhite)
thesymbolb.setolcolor(color.getblack)
shapeb.setsymbol(thesymbolb)
shapeb.invalidate
theglist.unselectall
shapeb.select
thenewglist = thelay.getgraphics
thenewglist.moveselectedtoback
pnt = point.make(0.15, -0.15)
thenewglist.unselectall
shapea.select
thenewnewglist = thelay.getgraphics
thenewnewglist.moveselectedtoback
thenewsel = thenewnewglist.getselected.get(0)
thenewsel.offset(pnt)
thenewglist.unselectall
'
'-- If you want to group the frame with the shaodow graphics,
'-- uncomment this section.
'
'theglistshape = graphiclist.make
'theglistshape.add(theshapefirst)
'for each r in theglistshape
' r.setselected(true)
'end
theglistnew = graphiclist.make
theglistnew.add(shapea)
theglistnew.add(shapeb)
for each i in theglistnew
i.setselected(true)
end
thesellst = thelay.getgraphics
thesellst.GroupSelected
thelay.invalidate
thelay.getdisplay.flush
av.purgeobjects
Get help from ArcGIS experts
Download the Esri Support App