<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is it possible to share values in Collaboration using sendPython? in VRED Forum</title>
    <link>https://forums.autodesk.com/t5/vred-forum/is-it-possible-to-share-values-in-collaboration-using-sendpython/m-p/13833424#M11894</link>
    <description>&lt;P&gt;I found a work-around, but it is a bit rough:&lt;/P&gt;&lt;P&gt;1) Get a list of connected sessions: myCollabs= vrSessionService.getUsers()&lt;/P&gt;&lt;P&gt;2) Get the host: myHost = myCollabs[0]&lt;/P&gt;&lt;P&gt;3) Use myHost.sendPython(... in combination with mySet = vrVariantSets.createVariantSet(... to create a variant set on ONLY the host.&lt;/P&gt;&lt;P&gt;4) Use myHost.sendPython(... in combination with mySet.addScript(... to add script to the variant set which calls global masterList and then appends the desired entries to the list.&amp;nbsp; This is tricky to parse the string delimeters using ', \', \\', etc.&amp;nbsp; But it works!&lt;/P&gt;&lt;P&gt;4) Use vrVariantSets.deleteVariantSet(... to remove the variant set from the host.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of this cleanly adds entries to the masterList on the host session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone thinks of a better way to do this, let me know!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-CH&lt;/P&gt;</description>
    <pubDate>Wed, 01 Oct 2025 19:53:59 GMT</pubDate>
    <dc:creator>chaaseLTH9X</dc:creator>
    <dc:date>2025-10-01T19:53:59Z</dc:date>
    <item>
      <title>Is it possible to share values in Collaboration using sendPython?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/is-it-possible-to-share-values-in-collaboration-using-sendpython/m-p/13831736#M11893</link>
      <description>&lt;P&gt;I have a Collaboration session with custom scripts running on both sides.&amp;nbsp; I would like to be able to send parameter values back and forth between the VRED Pro 2026.1 instances.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried something like creating a list in one session:&lt;/P&gt;&lt;P&gt;global masterList&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in the other session I created a command which should append an entry to that list:&lt;/P&gt;&lt;P&gt;myCmd = "masterList.append(5)"&lt;/P&gt;&lt;P&gt;vrSessionService.sendPython(myCmd)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I just get this error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NameError: name 'masterList' is not defined&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas to get this to work?&amp;nbsp; Or is there a better way?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-CH&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 19:19:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/is-it-possible-to-share-values-in-collaboration-using-sendpython/m-p/13831736#M11893</guid>
      <dc:creator>chaaseLTH9X</dc:creator>
      <dc:date>2025-09-30T19:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to share values in Collaboration using sendPython?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/is-it-possible-to-share-values-in-collaboration-using-sendpython/m-p/13833424#M11894</link>
      <description>&lt;P&gt;I found a work-around, but it is a bit rough:&lt;/P&gt;&lt;P&gt;1) Get a list of connected sessions: myCollabs= vrSessionService.getUsers()&lt;/P&gt;&lt;P&gt;2) Get the host: myHost = myCollabs[0]&lt;/P&gt;&lt;P&gt;3) Use myHost.sendPython(... in combination with mySet = vrVariantSets.createVariantSet(... to create a variant set on ONLY the host.&lt;/P&gt;&lt;P&gt;4) Use myHost.sendPython(... in combination with mySet.addScript(... to add script to the variant set which calls global masterList and then appends the desired entries to the list.&amp;nbsp; This is tricky to parse the string delimeters using ', \', \\', etc.&amp;nbsp; But it works!&lt;/P&gt;&lt;P&gt;4) Use vrVariantSets.deleteVariantSet(... to remove the variant set from the host.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of this cleanly adds entries to the masterList on the host session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone thinks of a better way to do this, let me know!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-CH&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 19:53:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/is-it-possible-to-share-values-in-collaboration-using-sendpython/m-p/13833424#M11894</guid>
      <dc:creator>chaaseLTH9X</dc:creator>
      <dc:date>2025-10-01T19:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to share values in Collaboration using sendPython?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/is-it-possible-to-share-values-in-collaboration-using-sendpython/m-p/13839267#M11901</link>
      <description>&lt;P&gt;Hi, the vrSessionService.sendPython executes the Python on both the sending and the connected VRED instances.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So that means, if only one VRED instance has an object named masterList, and it does not exist on the other VRED instances, you need to send a command that handles the case that it does not exist:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;cmd = """
if 'masterList' in globals():
    masterList.append(5)
    print("added 5 to masterList")
"""
vrSessionService.sendPython(cmd)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, as an alternative idea, you could also check for the User name and let it only execute by the VRED instance where the user has a certain name:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;cmd = """
if vrSessionService.getUser().getUserName() == "host":
    masterList.append(5)
    print("added 5 to masterList")
"""
vrSessionService.sendPython(cmd)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 14:42:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/is-it-possible-to-share-values-in-collaboration-using-sendpython/m-p/13839267#M11901</guid>
      <dc:creator>sinje_thiedemann</dc:creator>
      <dc:date>2025-10-06T14:42:03Z</dc:date>
    </item>
  </channel>
</rss>

