0

Adding (not replacing) sources to rv through python

Hi,

This is using python on rv 6.2.6. It behaves simillarly on rv 7.1.2.

I can add multiple sources (.rv files) at the same time by using rv.commands.addSources(). They are then loaded in order as I would expect.

However, I cannot add any further sources. Anything I add after the initial add simply replaces what was there before. I have tried using the addSource and addSources commands, as well as the merge=True flag. None of it seems to work. Using the "merge" command from the File menu works, so obviously it is possible.

So this works:

import rv.commands as rvc
rvc.addSources([rvFilePath1, rvFilePath2, rvFilePath3]) 

But this only shows the last file added:

import rv.commands as rvc
rvc.addSources([rvFilePath1])
rvc.addSources([rvFilePath2], merge=True)
rvc.addSources([rvFilePath3], merge=True)

What am I doing wrong?

Thanks, Sumit

1 comment

  • Avatar
    (Michael) Kessler Official comment

    Hi Sumit

    I've found a workaround but it also highlights a problem that I've written up in an internal bug ticket.  If you access all the arguments of addSource as positional arguments rather than keyword arguments, it works.

    For example:

    import rv
    rv.commands.addSources(["/Users/kesslem/merge.rv"], "test", False, True)
Please sign in to leave a comment.