Content cache error due to active command when running from rhino

Hi every one,

I’m trying to publish a package to have a command that launch a script, push some stuff from grasshopper to rhino using content cache, then close.

My python script run well when I launch it from the script editor, but when I publish it into the package manager and run the command from rhino, the content cache component fail execute with the folloing errror: 1. Can’t modify the document while other command is running.

I have tried different method to trigger recompute but get stuck with it…

Any clue or am i doing something wrong ?

Found a workaround by adding a data dam in front of the content input, but if there is a better solution I’m glad to learn.

Using grasshopper player seem’s to work as expected (without datadam). For now this solution is working for me

import rhinoscriptsyntax as rs
file_path = r"Z:\xxx.gh"
rs.Command(f’-_GrasshopperPlayer “{file_path}”')