GX Developer - Creating a new string channel in python

Hello,

I have a script which generates a pd channel with string data. When i try to make a new channel in the database it only allows byte or double. Is there a was to put string data e.g. dipole into the database via python GX?

I am using Oasis montaj 2025.1

Answers

  • PrachiChitkara
    PrachiChitkara Posts: 413 admin

    @ArtemGorbunov @EmilNielsen have any of you encountered this and been able to resolve?

  • Hi SandTeam
    Maybe these lines can help.

    import geosoft.gxpy.gdb as gxgdb
    gxp = gxpy.gx.GXpy()
    gdbPath = r'c:\GeosoftPY\test_str_channel.gdb'
    gsdb = gxgdb.Geosoft_gdb.open(gdbPath)
    gsdb.write_channel('L0','String',['A1','A2'],fid=(0.0, 1.0))
    gsdb.close()

    image.png
  • Thank you! this works for me now!