Message 1 of 1
[python][MaxPlus] Inherit INode Class
Not applicable
09-27-2018
06:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I woul like to inherit INode class in order to act some custom properties and methods to this new class, but for some reason is not working with the usual syntax to do this in python. Any idea why is that?
import MaxPlus
class CustomNode(MaxPlus.INode):
"""docstring for MaxNode"""
def __init__(self, nodes):
MaxPlus.INode.__init__(self)
self.test = "showme"
MaxPlus.Core.EvalMAXScript("point()")
p = CustomNode.GetINodeByName("Point001")
print isinstance(p, MaxPlus.INode) # this returns True
print p.test # <type 'exceptions.AttributeError'> 'INode' object has no attribute 'test'