GetAsText, in scripting at least, does return the "B:" prefix.
But SetAsText ignores it.

OTOH, SelectObj takes it.

si = Application
sel = si.Selection
Application.SelectObj("XSI_Man", "BRANCH", "")
tmp = sel.GetAsText()
print tmp
# B:XSI_Man
sel.Clear()
si.SelectObj(s)
print sel.GetAsText()
# B:XSI_Man





On 28/02/2013 1:49 PM, Alan Fregtman wrote:
For every item in the Selection object, there's .BranchFlag property which will return 1 if it was branch selected, or 0 if not.

Perhaps build your own GetAsString equivalent where you prefix "B:" before any FullName that is branch-selected?



On Thu, Feb 28, 2013 at 12:06 PM, Mihail Djurev <[email protected] <mailto:[email protected]>> wrote:

     Hello, list!

    I have a command that clears the selection as a side effect. I
    want to memorize the selection before calling it, so I can restore
    it later.

    I tried to keep the string from the GetAsString() method and then
    restore it via SetAsString(), but that didn't seem to work for
    branch select.

    Right now I'm using the GetArray() method and later on I'm adding
    all the CRefs to the selection. This seems to keep the selection
    for all cases that I've tried, but there's an annoying side
    effect. Every time I have polygons selected, the selection filter
    is changed.

    Any thoughts?

    Thanks
    Mihail



Reply via email to