1

I am loading a ".avl" legend file into ArcView 3.1 and I am plagued with a recurring Segmentation Violation Error when I execute the updatelegend command in the theme.

It looks like the legend file was successfully loaded (evidenced by the updated legend thumbnail on the theme name in the view), but the actual image in the view does not update. If I double-click on the theme and click the "apply" button in the legend editor, then it works no problem, but I can't get the code to work!

The sample code is:

theView = av.GetActiveDoc
x = theView.GetThemes.Get(0)
theLegend = x.GetLegend

chk = theLegend.Load("C:\ArcView\Legend1.avl".AsFileName , #LEGEND_LOADTYPE_ALL)

if (chk) then 

  x.SetLegend(theLegend) 
  x.UpdateLegend 

end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.