[gme-users] Addon woes with Subtypes and Instances
Larry Howard
howardlp at isis.vanderbilt.edu
Tue Mar 30 17:30:33 CST 2004
GME sends OBJEVENT_ATTR events to Addons for objects which are derived (subtypes or instances) when an attribute value in the base type is modified. These notifications are redundant and require the Addon developer to code around them.
The workaround is fairly straightforward, and I mention it here so that other Addon developers might benefit. The following code is Python.
attr = obj.Attribute(obj.Meta.AttributeByName("SomeAttribute"))
if attr.Status < 1:
# the attribute is not inherited, so act on the OBJEVENT_ATTR notification
So, the Status property of an IMgaAttribute has a value >= 1 if the attribute is inherited. If it is inherited, then whatever action is taken for the object serving as the base type is sufficient.
I hope that these redundant notifications will go away, because they could cause an Addon to misbehave unless the check suggested above is made. BTW, it should also be observed that the OBJEVENT_ATTR notification provides no information regarding which attribute changed. (Yuk!)
Regards,
lph
--
Larry Howard
Sr. Research Scientist
Institute for Software Integrated Systems, Vanderbilt University
howardlp at isis.vanderbilt.edu voice: (615) 343-7447 fax: (615) 343-7440
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20040330/a60bca3d/attachment.htm
More information about the gme-users
mailing list