Auto Share python Add on

Dear friends:
I’m trying to make a plugin so that you can auto-share all components automatically. I find that I can find them, but I can’t enable the auto share command, why is this?
Thank you so much for your willingness to help me!
SharedAllFeatures_HomeTab.zip (1.9 KB)

python:
from vcCommand import *
import vcMatrix
app = getApplication()
sim = app.Simulation

def my_state():
shared = [c for c in app.Components if c.IsUnique == True]

for c in shared:
#c.IsUnique == False
print c.Name
#c.AutoShare = True

addState(my_state)

Could not find AutoShare property in the help document.

auto-share all components automatically

Do you mean vcApplication().autoShareFeatureTrees()?

https://help.visualcomponents.com/4.8/Premium/en/Python_API/vcApplication.htm?rhhlterm=autosharefeaturetrees

from vcCommand import *
app = getApplication()
app.autoShareFeatureTrees()

SharedAllFeatures_HomeTab.zip (1.9 KB)

Yes. You are right! Thank you!

1 Like