better stated: certain parameter name, not value, apologies, running behind
on sleep, words are challenging.
On Feb 27, 2013 7:54 PM, "Enoch Ihde" <[email protected]> wrote:

> these are the three methods i've tried.
> using tags is the fastest, but a little prohibitive, as you have to have
> anticipated needing to get a param quickly, so it must be tagged in
> advance.  also, even with getting by tags, performance imo is pretty poor.
>
> results on my machine from the code below:
> # INFO : object count is 3618
> # INFO : 0.788785183814
> # INFO : tagged param count is 3618
> # INFO : 2.12563553863
> # INFO : 7.84713397563
>
>
> is there a better way?
> <snip>
>
> import time
> import win32com.client
> xsi    = win32com.client.Dispatch( "XSI.Application" ).Application
> xsiPrint = xsi.LogMessage
> from win32com.client     import constants as c
> items = xsi.ActiveSceneRoot.FindChildren2()
>
> ##### this bit is really slow
> for item in items:
>     xsi.Tag(item.fullname + '.visibility.viewvis', c.siTag1)
> xsiPrint('object count is ' + str(items.count))
> #### and only needs to be run once
>
> t = time.clock()
> val = xsi.ActiveSceneRoot.TaggedParameters(c.siTag1, False)
> for v in val:
>     someStuff = v.value
> xsiPrint(time.clock() - t)
>
> xsiPrint('tagged param count is ' + str(val.count))
>
> t = time.clock()
> for obj in items:
>     vis = obj.GetPropertyFromName2("Visibility")
>     v = vis.viewvis.value
> xsiPrint(time.clock() - t)
>
>
> t = time.clock()
> for obj in items:
>     vis = obj.Properties('visibility').Parameters('viewvis').value
> xsiPrint(time.clock() - t)
>
> </snip>
>
> tia,
> enoch
>
>
>
>

Reply via email to