[lammps-users] How to access lattice vectors in the code?

Dear LAMMPS developers,

I am trying to implement a command of my own into LAMMPS, and this command needs to get access to the lattice orientation vectors of the system. Is there an easy way of doing this?

So far, what I have done is to edit the file lattice.h and moved the vectors orientx, orienty and orientz from the "private" to the "public" part, in order to get access to these vectors from another part of the program. In my own command file I can then write the following to read out the orientations:
  int *orientx = domain->lattice->orientx;
etc.

This works (seemingly) fine, but I do not like editing the original LAMMPS files when adding my own routines. Is there a more elegant way of doing this, so that I can avoid editing the lattice.h file?

Sincerely,
Christer H. Ersland.

What you've done is fine. No other command needs to access the lattice
vectors, so haven't done this before.

Steve