Writing a GX/python script to edit base layers within multiple maps

MaxLayton
MaxLayton Posts: 1 Calcite Rank Badge
edited February 2023 in GeoStudio
Hi there,

I want to create either a GX or a python script that will load in a bunch of .map files and then edit a specific base layer.

More specifically, if I have several maps with the same base layer, where that layer is just a text box with a string in it - I want to edit that text box without having to open each map individually.

I.e the revision layer on many maps has a text box saying "A", and I want to change them all to "B" without having to open each map and do them one by one.

I am familiar with python, although I am not familiar with the gxapi or gxpy modules, but if it is easier for me to learn the GX syntax and do it as a GX that is fine as well. Does anyone have an idea as to which functions I want to use to do this?

Thanks in advance,

Max

Comments

  • Max, I would probably use Python.

    My approach would be to place the text you expect to change in its own group named, say "Var_text". I would then iterate through .map files, open the view that contains the "Var_text" group and simply replace it with a new "Var_text" group with the new text.

    Or do you need to be able to read the existing text in the group? If so, we do not have the ability to do that from the map (at least I don't think you can - someone may correct me). If you need to read existing text, you can place a copy of the text in the map metadata and recover it from there.
    Geosoft logo
This discussion has been closed.