New answers tagged

0

The MXD file's layer seemed to have something wrong with it so I couldn't simply just publish it. Also doing that didn't allow me edit some information regarding the layers. I ended up finding a gdb file which allowed me to add the layers and edit them as I saw fit.


0

According to my opinion you are mixing something up. If you are writing some code to use inside a running ArcMap process you have to work with the IMxDocument. In a standalone application without ArcMap only using arcobjects you have to work with the IMapDocument to access an MXD. Using both at once does not work correctly. If you like to access the style ...


5

The problem might be a very simple typo in this case, no big deal at all. The code posted in your question is providing a reference to the callable object with the name mxd.save, it doesn't appear to be actually executing the save method onboard the mxd object. The original code here will pass through silently without error, which is indeed ...


0

As suggested by @Steph in a comment: I just made file extensions visible via File Explorer Options and changed the extension to .MXD and it worked. The file had ".mxd" in the title so I didn't realize that wasn't the actual file extension.


2

In my search to find an answer to the same question, I came across this post first. However, after attempting to run the above supplied script, I was unable to create any output in the csv that was generated. Searching again, I came across this (duplicate question/post?) post on Stack that did run successfully, and in addition to listing data sources, looped ...


2

Extending on Chad's answer, following does the trick for feature layer with multiple legend groups for (int k = 0; k <= (featureLayer as ILegendInfo).LegendGroupCount - 1; k++) { (featureLayer as ILegendInfo).get_LegendGroup(k).Visible = false; }



Top 50 recent answers are included