For the Scene Layer Manager, there is a selectedlayer attribute.
For the Schematic view, there are two view attributes: AnchorPointID and Target.
Target is available for the node context menu only.
Here’s some code from the new Schematic example in the XSI SDK workgroup:
def XSILoadPlugin( in_reg ):
#...
in_reg.RegisterMenu(C.siMenuSchematicNodeContextID,"LogNodeInfo_Menu",False,False)
#...
def LogNodeInfo_Menu_Init( in_ctxt ):
oMenu = in_ctxt.Source
oMenu.AddCallbackItem("Log Node Info","log_info_cb")
return True
def log_info_cb( ctxt ):
Application.LogMessage("log_info_cb called")
# Returns the view object or a list with the view object and the target node (siMenuSchematicNodeContextID only)
target = ctxt.GetAttribute('Target')
anchorPtID = ctxt.GetAttribute('AnchorPointID')
# ...