HOW TO
This script is one method you can use to create a neatline for a layout.
Code:
'-- Script Layout.GraphicNeatline
'-- This script creates a double neatline based on
'-- page margins and user settings
theLayout = av.GetActiveDoc
theDisplay = theLayout.GetDisplay
theGraphics = theLayout.GetGraphics
thePageExtent=theDisplay.ReturnPageExtent
theMarginExt=theDisplay.ReturnMarginextent
dialoglabels1={"Neatline 1: Scale", "Neatline 1: Width (pts)",
"Neatline 2: Scale", "Neatline 2: Width (pts)"}
defaults1={"0.95","1.5","0.90","0.75"}
inputlist1=msgbox.multiinput("Select the parameters for your
neatline.","Neatline",
dialoglabels1,defaults1)
if (inputlist1.count=0) then
exit
end
if (inputlist1.count<>4) then
msgbox.error("You must fill in all values in the settings.","Error")
exit
end
offset1=inputlist1.get(0).asnumber
offset2=inputlist1.get(2).asnumber
width1=inputlist1.get(1).asnumber
width2=inputlist1.get(3).asnumber
neat1rect=theMarginExt.clone.Scale(offset1)
neat2rect=theMarginExt.clone.Scale(offset2)
aSymbol = RasterFill.Make
aSymbol.setstyle(#RASTERFILL_STYLE_EMPTY)
aSymbol.SetOLColor(Color.GetBlack)
gneat1 = GraphicShape.Make(neat1rect)
gneat1.SetSymbol(aSymbol)
gneat1.getSymbol.setOLwidth(width1)
gneat2 = GraphicShape.Make(neat2rect)
gneat2.setSymbol(asymbol.clone)
gneat2.getSymbol.setOLwidth(width2)
theGraphicGroup=GraphicGroup.Make
theGraphicGroup.add(gneat1)
theGraphicGroup.add(gneat2)
oldselected=theGraphics.getselected.clone
theGraphics.Add(theGraphicGroup)
theGraphics.Unselectall
theGraphicGroup.Setselected(TRUE)
theGraphics.MoveSelectedToBack
theGraphicGroup.setselected(FALSE)
for each agraphic in oldselected
agraphic.setselected(TRUE)
end
Article ID:000003802
Get help from ArcGIS experts
Download the Esri Support App