Another look at IsElement problems

I’ve had some problems with IsElement lately, so I took another look at how to work around problems with IsElement, especially when you’re using it with ICE topology. Also, a quick look under the covers at the connections in the construction stack (aka operator history).

Here’s the script I was using to print the connection stack info:

# This script works in 2013 SP1 only because it uses sipyutils 
from sipyutils import si			# win32com.client.Dispatch('XSI.Application')
from sipyutils import siut		# win32com.client.Dispatch('XSI.Utils')
from sipyutils import siui		# win32com.client.Dispatch('XSI.UIToolkit')
from sipyutils import simath	# win32com.client.Dispatch('XSI.Math')
from sipyutils import log		# LogMessage
from sipyutils import disp		# win32com.client.Dispatch
from sipyutils import C			# win32com.client.constants

siut =siut()

sisel = si.Selection

from xml.etree import ElementTree as ET

prim = sisel(0).ActivePrimitive if si.ClassName(sisel(0)) ==  'X3DObject' else sisel(0)

stackInfo = siut.DataRepository.GetConnectionStackInfo( prim )
#log( stackInfo )
connections = ET.XML(stackInfo)
currentMarker =''

print "Connections for %s" % prim.FullName
for connection in connections:
		o = connection.find('object').text
		if o == currentMarker:
		if o.endswith('marker'):
			currentMarker = o
		print "%s (%s)" % (connection.find('object').text, connection.find('type').text)

6 thoughts on “Another look at IsElement problems

  1. whaaaat! no wonder I have been getting inconsistencies like this when trying to figure ICE topo out. and the only way to fix it is rebuild the entire tree? So the logic is broke on the stack when randomly repeated on just two nodes – is it only clusters? or Topo in general? as I notice you cannot emit from a changing Topo nor export a model and reload it without a crash. perhaps this is related. thanks for the scripts will look out for those cycle inconsistencies next time the nodes stays red even though the same thing worked a moment before!

  2. and also another one there is an error with polymorhic node types when reloading a scene – attributes from a cache which were vectors are being interpreted as oilymesh objects! have to recreate entire tree to get the vectors back…

  3. and cant run that script either :/

    # ERROR : Traceback (most recent call last):
    # File “”, line 1, in
    # from sipyutils import si # win32com.client.Dispatch(‘XSI.Application’)
    # ImportError: No module named sipyutils
    # – [line 1]

    • Yes, sipyutils is new in 2013 SP1.

      In 2012 SAP, you would replace those imports with something like:

      from siutils import si # win32com.client.Dispatch(‘XSI.Application’)
      from siutils import siut # XSIUtils
      sisel = si.Selection

  4. ha! sorry to be a pain Mr Blair , found the culprit with the polymorphism errors – ICE was not correctly saving the attribute (again) so forcing an attribute display fixed this issue. next the python thing – this was a 2012 issue and sorted that now. so think we are good!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s