HOW TO
In ArcView, you cannot scale graphics entered with the graphic tools or text symbols that are entered with the text tool.
Code:
theView = av.GetActiveDoc
theDisplay = theView.GetDisplay
graphsel = {"TEXT", "GRAPHIC"}
graphictype = msgbox.choiceasstring(graphsel, "Symbol Type:",
"ScaleProperties")
if (graphictype = nil) then
exit
elseif (graphictype = "TEXT") then
theGTL = theView.GetGraphics.FindAllByClass(graphictext)
thingsToStopScaling = theView.GetGraphics.GetSelected
theSelGTL = {}
elseif (graphictype = "GRAPHIC") then
theGTL = theView.GetGraphics.FindAllByClass(graphicshape)
thingsToStopScaling = theView.GetGraphics.GetSelected
theSelGTL = {}
end
scalesel = {"ON", "OFF"}
scalechoice = msgbox.choiceasstring(scalesel, "Scale ON or OFF",
"ScaleProperties")
if (scalechoice = nil) then
exit
elseif (scalechoice = "ON") then
for each g in thingsToStopScaling
if (g.Is(graphictext)) then
g.GetSymbol.UnHook
elseif (g.Is(GraphicShape)) then
if (g.GetShape.Is(polygon).Not) then
g.GetSymbol.UnHook
end
end
end
for each gt in theGTL
if (gt.IsSelected)
then
theSelGTL.Add(gt)
end
end
for each gt in theSelGTL
theDisplay.HookupSymbol(gt.GetSymbol)
end
elseif (scalechoice = "OFF") then
for each g in thingsToStopScaling
if (g.Is(graphicText)) then
g.GetSymbol.UnHook
elseif (g.Is(GraphicShape)) then
if (g.GetShape.Is(polygon).Not) then
g.GetSymbol.UnHook
end
end
end
end
av.purgeobjects
Article ID:000002873
Get help from ArcGIS experts
Download the Esri Support App