Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

Thanks,

-Louis

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.